zopefoundation / Products.PluggableAuthService

Pluggable Zope authentication / authorization framework
Other
9 stars 18 forks source link

Plone 4 ZMI: Assigning principals to a group in source_groups throws an exception #84

Closed batlock666 closed 3 years ago

batlock666 commented 3 years ago

Every time I try to add a principal to a group in source_groups, I get the following exception:

Traceback (innermost last): Module ZPublisher.WSGIPublisher, line 162, in transaction_pubevents Module ZPublisher.WSGIPublisher, line 359, in publish_module Module ZPublisher.WSGIPublisher, line 262, in publish Module ZPublisher.mapply, line 85, in mapply Module ZPublisher.WSGIPublisher, line 63, in call_object Module Products.PluggableAuthService.utils, line 4, in wrapper Module , line 4, in manage_addPrincipalsToGroup Module AccessControl.requestmethod, line 88, in _curried Module Products.PluggableAuthService.plugins.ZODBGroupManager, line 385, in manage_addPrincipalsToGroup Module Products.PlonePAS.plugins.group, line 76, in addPrincipalToGroup Module Products.PluggableAuthService.plugins.ZODBGroupManager, line 270, in addPrincipalToGroup TypeError: '<' not supported between instances of 'str' and 'list'

Steps to reproduce:

  1. Go to source_groups.
  2. Select a role.
  3. Click "(Assign)".
  4. Search for a principal.
  5. Select the found principal.
  6. Click the right arrow (->).
  7. Exception!

Versions:

This issue is similar to #43 .

dataflake commented 3 years ago

Duplicate of several issues here and fixed in release 2.5

d-maurer commented 3 years ago

Bert Vanderbauwhede wrote at 2020-11-13 02:59 -0800:

Every time I try to add a principal to a group in source_groups, I get the following exception:

Traceback (innermost last): ... Module , line 4, in manage_addPrincipalsToGroup Module AccessControl.requestmethod, line 88, in _curried Module Products.PluggableAuthService.plugins.ZODBGroupManager, line 385, in manage_addPrincipalsToGroup Module Products.PlonePAS.plugins.group, line 76, in addPrincipalToGroup Module Products.PluggableAuthService.plugins.ZODBGroupManager, line 270, in addPrincipalToGroup TypeError: '<' not supported between instances of 'str' and 'list'

This looks as if group_id were a list (maybe group_id and principal_ids have become interchanged).

Look at the information from the error_log object. What content has Request.form?

batlock666 commented 3 years ago

@dataflake

I have checked the list of tickets. I agree that this ticket is a duplicate of ticket #61 . It is however not a duplicate of tickets #43 , #51 , #54 , or #56 . Those tickets were about a bug in view manage_roles. This bug was fixed in pull request #44 .

This ticket is about a bug in view manage_groups. This bug has not yet been fixed. I'm using the master branch in my buildout, and I still get the exception.

@d-maurer

The group ID being a list is just caused by a missing

-tag. This causes two separate forms to be considered one single form, and you get weird stuff like that. See ticket #43 for the same problem in view manage_roles.

dataflake commented 3 years ago

@batlock666 Your description confuses me. You explicitly claimed to use PluggableAuthService 2.4, which is not the latest release and doesn't have these fixes. Now you claim you use the latest master.

I have a Zope 4 instance with the lastest released version (2.5) and have no issues assigning principals to groups.

dataflake commented 3 years ago

@batlock666 Can you verify that #85 fixes the issue? I couldn't reproduce it so I am guessing it browser-specific. You didn't provide information about the browser you use.

batlock666 commented 3 years ago

@dataflake I got the error with PAS 2.4. You said it was fixed in PAS 2.5. So I switched PAS to the latest master (which should contain the fix) in my buildout. And I still got the error.

I got the error in both Chromium 86 and Firefox 82 (in Ubuntu). I currently have no other browsers installed. I guess it could be browser related, depending on how the browser handles malformed HTML.

85 fixes the problem for me. It changes an unnecessary \<table>-tag into a necessary \</div>-tag. With this fix, the form works as it should. This is exactly the same solution I used in pull request #44 .

dataflake commented 3 years ago

I agree that the tag was broken but the symptoms appear to be browser-specific. I didn't see an issue with FF 82.0.3 on macOS. Anyway, I uploaded version 2.5.1 with your fix.