"Group by attribute" causes error
Aren Cambre - March 30, 2009 - 04:34
| Project: | LDAP integration |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
| Issue tags: | ldapgroups |
Jump to:
Description
If I enable "Group by attribute," I get these errors:
warning: Illegal offset type in isset or empty in /var/www/drupal/sites/default/modules/ldap_integration/ldapgroups.module on line 300.
warning: preg_match() expects parameter 2 to be string, array given in /var/www/drupal/sites/default/modules/ldap_integration/ldapgroups.module on line 302.Wireshark doesn't show any instance where a searchRequest is done on just the memberOf attribute of the user's directory entry, so I presume you're pulling the memberOf data from one of the searchRequests that returns all 87 attributes on my user's directory entry.
I am using Active Directory.

#1
I just noticed that one role did get created in Drupal. Strangely, the role's name was the group's DN instead of CN. (See #417900: Role names are truncated DNs instead of CNs.)
However, the role's name was so long that it got truncated at 64 characters. Are Drupal role names limited to 64 chars? Does this help explain the error?
#2
First, do you use "PHP to filter roles by:" filter in the ldapgroups configuration? One should be extremely caution with this php code.
There is a "Mapping of LDAP groups to Drupal roles:" settings exactly for tis purpose - to change a group's full DN to a friendly role name. Do you use it?
#3
I left "PHP to filter roles by:" blank.
"Use LDAP group to Drupal roles filtering" is unchecked. Below, its description says if it's not checked, "a Drupal role will be created for every group the user is associated with." So should I be seeing a Drupal role corresponding to each group to which a user is a member?
#4
I'm getting this error when I have group by attribute turned on i'm using the latest 6.x-1.x-dev mar 30 dev release. Here is what it is outputing:
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /afs/cad.njit.edu/web/learningspaces/carbon/includes/database.mysqli.inc on line 323.
warning: Illegal offset type in isset or empty in /afs/cad.njit.edu/web/learningspaces/carbon/sites/all/modules/ldap_integration/ldapgroups.module on line 296.
warning: preg_match() expects parameter 2 to be string, array given in /afs/cad.njit.edu/web/learningspaces/carbon/sites/all/modules/ldap_integration/ldapgroups.module on line 298.
warning: Illegal offset type in isset or empty in /afs/cad.njit.edu/web/learningspaces/carbon/sites/all/modules/ldap_integration/ldapgroups.module on line 296.
warning: preg_match() expects parameter 2 to be string, array given in /afs/cad.njit.edu/web/learningspaces/carbon/sites/all/modules/ldap_integration/ldapgroups.module on line 298.
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /afs/cad.njit.edu/web/learningspaces/carbon/includes/database.mysqli.inc on line 323.
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /afs/cad.njit.edu/web/learningspaces/carbon/includes/database.mysqli.inc on line 323.
#5
Keith: are you using Active Directory?
#6
I am getting a similar error:
* warning: Illegal offset type in isset or empty in /web/six/sites/all/modules/ldap_integration/ldapgroups.module on line 296.
* warning: preg_match() expects parameter 2 to be string, array given in /web/six/sites/all/modules/ldap_integration/ldapgroups.module on line 298.
This is on our test box and the only module installed is the the ldap module version 6.x-1.x-dev from March 30th . It is Drupal 6.10 on Ubuntu 8.04.2 Server using the standard AMP set-up. It is querying OpenLDAP 2.3.39 a field that is multi-value attribute field. If I can give any more information or try anything to test this out let me know as I am very interested in helping make the ldap module for drupal 6 ready for production.
--Brian
#7
I just noticed that on second and later logins, I get an additional error.
Here are all three, with the "additional" error being the last one starting with user warning: Duplicate entry:
warning: Illegal offset type in isset or empty in /var/www/drupal/sites/default/modules/ldap_integration.bak/ldapgroups.module on line 296.warning: preg_match() expects parameter 2 to be string, array given in /var/www/drupal/sites/default/modules/ldap_integration.bak/ldapgroups.module on line 298.
user warning: Duplicate entry 'CN=Web Sitecore Users,OU=Web Groups,OU=Groups,OU=University at L' for key 2 query: INSERT INTO ldaptest_role (name) VALUES ('CN=Web Sitecore Users,OU=Web Groups,OU=Groups,OU=University at Large,OU=xxx,DC=xxx,DC=xxx') in /var/www/drupal/sites/default/modules/ldap_integration.bak/ldapgroups.module on line 251.
(I intentionally x-ed out some details above.)
The third error tells me that whatever logic you're using to verify whether a role already exists is working differently than the logic to create the role name. Otherwise it wouldn't try to duplicate the role.
#8
No i'm not using active directory.
I have a fresh install of ldap module (current dev) and it is giving errors on login. I have a working ldap module on other sites using same server on same drupal multisite install but not with dev module.
#9
I believe this is fixed now, see #429186: unable to map AD Group to Role with Filtering, looking for support help..
#10
Thank you. Let us know when a new dev release is rolled out (in #376974: Next release is fine), and I'll check it out.
#11
Automatically closed -- issue fixed for 2 weeks with no activity.
#12
thanks. I'll test it out