Closed alecpm closed 3 weeks ago
FWIW we fixed a similar bug in plone.restapi recently: https://github.com/plone/plone.restapi/pull/1775
I think it can happen if a group is enumerated by a PAS plugin but it can't actually be fetched by id for some reason.
In your case maybe there is something wrong with what the dexterity.membrane PAS plugins are returning?
The offending code is here. The traceback looks like this:
The issue is that when there's a
None
value in thegroupResults
(which is anticipated in the sort code) the lambda returnsFalse
which fails to compare against the group title/name strings under Python 3. The list comprehension that definesgroupResults
should probably just filter outNone
values to avoid this issue. I'm not entirely sure what circumstances result in aNone
group value, but I am seeing it occur in a real world use case.