Immediatly after running the update.php script, I went to the URL 'admin/settings/ldap/ldapgroups/edit/1' and got the following error. (In BETA2, I was using 'memberOf' in the 'Group by attribute' property on that page.)
warning: implode() [function.implode]: Invalid arguments passed in ldap_integration/ldapgroups.admin.inc on line 123.
$form['group_attr']['ldapgroups_attr'] = array(
'#type' => 'textarea',
'#title' => t('Attribute names (one per line)'),
'#default_value' => implode("\n", ($edit['ldapgroups_attr'] ? unserialize($edit['ldapgroups_attr']) : array())),
'#cols' => 50,
'#rows' => 6,
'#description' => t('If the groups are stored in the user entries, along with the rest of their data, then enter here a list of attributes which may contain them.'),
);
LINE 123:
'#default_value' => implode("\n", ($edit['ldapgroups_attr'] ? unserialize($edit['ldapgroups_attr']) : array())),
At that point $edit['ldapgroups_attr'] is a string 'memberOf' not and array. So unserialize() makes it NULL, and NULL is not an Array() so PHP spits out that error.
Perhaps we need to add a step to the upgrade process to convert the variable from a string to an array.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ldapgroups.install.upgrade.attributes.settings.diff | 979 bytes | markDrupal |
| #1 | DB-after-update.png | 2.73 KB | markDrupal |
| #1 | DB-after-update-and-reenter-data-and-save-form.png | 3.48 KB | markDrupal |
Comments
Comment #1
markDrupal commentedHere is a screen shot of my database ldapauth table, you can see that even after running the update.php scripts (first picture) the attribute is saved as a string. Then When I type out 'memberOf' and click save on the form the attribute is resaved to the database as a serialized array.(second photo)
Comment #2
markDrupal commentedI wrote an upgrade function that fixes it for me.
Comment #3
johnbarclay commented