You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just been migrating a lot of our Dexterity types from the website to code and stumbled upon this issue. Apparently the cause is this line:
results = [(translate(ctype['title'], context=request), ctype)
for ctype in results]
results.sort()
The error happens when translating titles of existing types. In my case, I was creating a custom event type called "Termin", the German word for "event". When Plone tries to sort the content types, it translates "event" to "Termin", which causes Plone to attempt to sort the next occurence of the title name, which is the dict.
You can prevent the issue from happening by telling Plone to simply sort by ID instead in case of duplicates. results.sort(key = lambda x: (x[0], x[1].get('id', '')))
The same error also seems to happen in other parts of Plone, as shown here.
The text was updated successfully, but these errors were encountered:
I've just been migrating a lot of our Dexterity types from the website to code and stumbled upon this issue. Apparently the cause is this line:
The error happens when translating titles of existing types. In my case, I was creating a custom event type called "Termin", the German word for "event". When Plone tries to sort the content types, it translates "event" to "Termin", which causes Plone to attempt to sort the next occurence of the title name, which is the dict.
You can prevent the issue from happening by telling Plone to simply sort by ID instead in case of duplicates.
results.sort(key = lambda x: (x[0], x[1].get('id', '')))
The same error also seems to happen in other parts of Plone, as shown here.
The text was updated successfully, but these errors were encountered: