collective / pas.plugins.ldap

Zope (and Plone) PAS Plugin providing users and groups from LDAP directory
http://pypi.python.org/pypi/pas.plugins.ldap
Other
13 stars 20 forks source link

Cannot create a group into Plone when groups enabled with pas.plugins.ldap #94

Open glemignot opened 4 years ago

glemignot commented 4 years ago

Hello,

I've a Plone 5.2 instance with Zope 4.0/Python 3.7, on which pas.plugins.ldap is installed.

When the "Group_Introspection (getGroupById)" plugin is activated, the "create group" (@@usergroup-groupdetails) does an error :

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 155, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 337, in publish_module
  Module ZPublisher.WSGIPublisher, line 255, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 61, in call_object
  Module Products.CMFPlone.controlpanel.browser.usergroups_groupdetails, line 27, in __call__
  Module Products.PlonePAS.tools.groups, line 223, in getGroupById
  Module Products.PlonePAS.pas, line 229, in getGroup
  Module pas.plugins.ldap.plugin, line 656, in getGroupById
AttributeError: 'NoneType' object has no attribute 'decode'

After a quick reading of the code, it seems that the "create group" popup is the same than the "properties" tab of an existing group, and therefore it tries to get info on the group, calling getGroupById, but with an id of None since we are about to create a new group.

The pas.plugins.ldap code then fails to handle the None group id.

I guess the getGroupById method of pas.plugins.ldap.plugin should just return None if called with None as an argument.

Regards,