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.

Comments

agentrickard’s picture

Thanks. At DrupalCON, will review when I can.

Nice explanation of the patch, too.

agentrickard’s picture

Status: Needs review » Fixed
StatusFileSize
new900 bytes

Slight refactor, but great patch.

agentrickard’s picture

This does not affect D7.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.