collective / collective/pas.plugins.ldap

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

Open
#94 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
13
Forks
22
PR merge metrics
No merged PRs in 30d

Description

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,

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in pas.plugins.ldap.plugin at getGroupById, then reproduce the create-group flow through @@usergroup-groupdetails with Group_Introspection enabled. Check how a None group id reaches the method and verify that creating a group no longer raises the reported AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.