If any module implements hook_permission incorrectly, by not creating a nested array for each declared permission, then the permissions page gets a fatal error for an unsupported operand. The issue resides in the user_admin_permissions() function, which on line 690 loops through all permissions declared by module's hook_permissions implementation:

      foreach ($permissions as $perm => $perm_item) {
        // Fill in default values for the permission.
        $perm_item += array(
          'description' => '',
          'restrict access' => FALSE,
          'warning' => !empty($perm_item['restrict access']) ? t('Warning: Give to trusted roles only; this permission has security implications.') : '',
        );

The WSOD will occur if $perm_item is not an array. If it is not, then an unsupported operands fatal error occurs.

To correct this, the functions should check that $perm_item is an array before adding to it.

CommentFileSizeAuthor
#1 user.admin_.inc-1204198.patch736 bytessoyarma
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

soyarma’s picture

FileSize
736 bytes

Patch adding an is_array() check before the troublesome operand.

Anonymous’s picture

Status: Active » Closed (won't fix)

The general stance on this is that core doesn't babysit contrib code. If a contrib module breaks core with an implementation, then an issue should be filed against that module.

soyarma’s picture

Status: Closed (won't fix) » Needs review

I've actually had that stance mentioned to me before in light of this issue. While I actually agree with it, the people who actually suffer are the folks we're trying to get to adopt Drupal. I don't think its necessary everywhere, but the change between hook_perm to hook_permission seems to make this prudent.

takim’s picture

Issue summary: View changes

I do not think this patch is required anymore! It has been already fixed in current version of Drupal.

takim’s picture

Status: Needs review » Closed (outdated)