Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When a user inserts its secret code the account creation fail. The module registers this error in the log:
Invalid argument supplied for foreach() en la línea 1374 del archivo /var/www/drupal-5.2/sites/test.gulic.org/modules/ldap_provisioning/ldapprov.module.
I attach a patch to solve this problem.
Comment | File | Size | Author |
---|---|---|---|
ldapprov.module_0.patch | 376 bytes | jesustorres |
Comments
Comment #1
miglius CreditAttribution: miglius commentedThanks for spotting this bug.
The actual ldap creation error was to the fact that Last name (sn in ldap) is a required attribute. So if last name is not set I set sn attribute in ldap to the username value. Also have fixed the foreach statement.
Comment #2
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
ckngmiglius,
I reopen the issue as it seems the patch is not yet in the cvs nor in the latest release.
Comment #4
miglius CreditAttribution: miglius commentedThe code which you want to change in the patch
constructs a $data array with a registration form submitted data which will be saved in the db for the account approver to be able to review it. The problem is that under certain configuration (if we request only username and email in the registration form) the $data array might not be defined. If I apply your patch, then all hidden form elements, captcha answer (if captcha module is enabled) would be saved in the db, which is unnecessary.
The error says about empty array in line 1374. To fix it I have added a check if the array is not empty before foreach statement:
Can you just check with the latest code if you still are getting the warning in the log?