This error occurs on any installation, including a fresh installation of drupal 6.20 including domain access 6x-2.10.
Steps:
- Goto 'admin/user/user'
- Select a role which isn't used by any user (if no role exist, create one)
- Filter on the unused role
you should see the a warning similiar to:
* warning: array_keys(): The first argument should be an array in /public_html/sandbox_620/sites/all/modules/contrib/domain/domain.module on line 573.
* warning: Invalid argument supplied for foreach() in /public_html/sandbox_620/sites/all/modules/contrib/domain/domain.module on line 573.
The warning is caused by the following code:
// Add our domain elements.
foreach (array_keys($form['name']) as $uid) {
$form['user_domains'][$uid][0] = array('#value' => theme('item_list', _domain_user_list($uid)));
}
$form['name'] can be NULL, causing the warning, simply fix this by checking if $form['name'] is an array.
Which is done in the patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1083916.TidalWave.user_.patch | 900 bytes | agentrickard |
| domain-array_keys-warning.patch | 774 bytes | TidalWave |
Comments
Comment #1
agentrickardThanks. At DrupalCON, will review when I can.
Nice explanation of the patch, too.
Comment #2
agentrickardSlight refactor, but great patch.
Comment #3
agentrickardThis does not affect D7.