4teamwork/ftw.lawgiver — pull request #29 by Tschanzt (2013-12-09 16:38:14+00:00)
Title: make get_role_adapter failsafe if parents are sorted wrong

:construction:
@jone we had the issue that the autocomplete widget on the ftw.participation didn't work. When we started debuging we found an AttributeError which most likely stopped the ++widget++ traverser from working properly. Then we walked through the stack and found out that the Exception was raised in lawgiver.

It seems that request.PARENTS isn't always sorted in the same way which ends with the element 0 being the App which of course doesn't have portal_workflow.

This pr just returns None when this is the case but this isn't good imo. Shall we just try and take the last item or give the plonesite as context or is there another way to get my context?
/cc @maethu