RelatedItemsWidget and

I have a site with installed and I`d like to use the RelatedItems widget. If I just start typing into the Search Section (keul called it so - About the new Plone 5 "Related Items" widget) everything works as expected. But if I try to narrow the search by using the Explore Section no item is show anymore.

If you would like to reproduce it:

  • create a site
  • install
  • configure 2 languages
  • create a page in a language root folder (e.g. start)
  • create a folder in this language root folder (e.g. folder1)
  • create another page in this subfolder (e.g. folder1/page1)
  • edit the first page (start) - go to categorization tab
  • type page1 to relateditems widget => page1 item is displayed
  • click top left icon of the relateditem widget to select a folder
  • select folder1 in your language folder
  • it says "no matches" found => but I would expect to see page1 here

I have found out, that in the second case the catalog is called with a wrong path parameter in -

{u'path': {'query': [u'/testrelateditemswidget/en/en'], 'depth': 1}, 'sort_on': u'sortable_title', 'sort_order': 'ascending'}

There is two times en in the path.

Now I have no idea what is the source of this problem - is it because it only occurs if it is installed. Or Or something else?

tested versions: 3.0.16 and 4.0.2 2.2.3 and 3.0 1.3.14 and 1.3.15 3.1.1

I hope someone can help.

Hey! It's a trademark! :smile:

I think you found a bug, try to report it to issue tracker.

Hello everybody,

a very belated reply to this post, as I was bitten by the same bug a few days ago. Plone 5.2.4, Python 2.7 (if that is relevant).


I wanted to add (from the control panel) an "image" field to the Dexterity schema of the "Page" portal type, as a RelationChoice field pointing to image objects stored in a Plone folder. Long story short, I observed exactly the problem you described, PAM seems make the widget unusable.


A couple of weeks ago, I had created two new portlet types, each containing RelationChoice fields and, probably by chance, I had been able to have them work correctly, without even being aware of the problem with PAM.

So, I tried to compare both situations. Using the development tools in Firefox, I was able to notice that the widget in my Page objects was using the @@getSource view in its AJAX queries, whereas the widget in my portlets was using @@getVocabulary.

Everything seems to happen in file, the Pycharm debugger was a great help for pinpointing the problem. I've not been able to understand the "why", but at least I understand the "how".

My portlets use the following code:

    image = RelationChoice(
        description=_(u'Find the image'),
        pattern_options={'selectableTypes': ['Image']},

    link = RelationChoice(
        description=_(u'Find the content to link'),

As a result, the widgets in the portlets receive a vocabularyName attribute, which resuls in their using @@getVocabulary.

In contrast, the widget in my Page objects receives None in that attribute, and the view is changed to @@getSource. This happens despite my trying to provide a <vocabulary> or <vocabularyName> in the XML definition of the schema.


As a workaround, I will try to subclass the widget ( and try to force the vocabularyNameattribute to ''. It should be done today.

Hope this helps,



I've created my new widget (base on code from

from import RelatedItemsWidget
from z3c.form.interfaces import IFieldWidget
from z3c.form.widget import FieldWidget
from zope.interface import implementer

def RelatedItemsFieldWidget(field, request, extra=None):
    if extra is not None:
        request = extra
    field.vocabularyName = ''
    return FieldWidget(field, RelatedItemsWidget(request))

And I've added it to the XML definition of my field:

<field name="image" type="z3c.relationfield.schema.RelationChoice"

Everything seems to work now :champagne: :champagne: :champagne:

Plone Foundation Code of Conduct