While I was saving Permissions I got the following warning many times:

warning: in_array() [function.in-array]: Wrong datatype for second argument in /sata1/home/users/kvikidoo/www/www.kvikidoo.com/drupal/modules/content_access/content_access.admin.inc on line 369.

Other installed modulels except non-standard are ACL.

Comments

bnice5000’s picture

I am receiving the same error.

in_array() [function.in-array]: Wrong datatype for second argument in /web/six/sites/all/modules/content_access/content_access.admin.inc on line 369.

but only when I try to update the role from the roles -> edit permissions. When I edit it from the permissions menu I do not receive the error.

I have the following modules installed:

ACL 6.x-1.0-beta2
Admin Role 6.x-1.0-beta2
Advanced help 6.x-1.1
Content Construction Kit (CCK) 6.x-2.1
Content Access 6.x-1.x-dev (2008-Oct-30)
Date 6.x-2.0-rc5
LDAP integration 6.x-1.0-alpha2
SimpleViews 6.x-1.0
Views 6.x-2.1

glass.dimly’s picture

Same error. Does this effect the actual assignment of permissions, or is it just complaining? Anyone know? If so, this bug needs to be marked major.

Thanks,
glass.dimly

glass.dimly’s picture

Priority: Minor » Normal

Changed priority to normal until it can be ascertained whether or not permissions assignment using Drupal core permissions is affected.

discursives’s picture

Same here. No issues as yet. Would be nice to 'understand' why this is happening... fago?

brack’s picture

In my experience the problem only occurs when changing permissions by editing a specific role. The code assumes you're coming in via 'permissions' rather than 'roles' but in this case the $form_state['values'] array only has data for the specific role so iterating through all roles causes the warning.

I got rid of the warning by changing the offending line to only check against existing role ids in the $form_state['values'] array:

if (isset($form_state['values'][$rid]) && (in_array($perm, $form['checkboxes'][$rid]['#default_value']) != in_array($perm, $form_state['values'][$rid]))) {

...Ian.

fago’s picture

Status: Active » Fixed

thanks, indeed the code assumed it's the whole permissions page. I've fixed that in 6.x-dev.

Status: Fixed » Closed (fixed)

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