Closed (fixed)
Project:
Content Access
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Dec 2008 at 08:30 UTC
Updated:
26 Dec 2008 at 15:22 UTC
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
Comment #1
bnice5000 commentedI 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
Comment #2
glass.dimly commentedSame 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
Comment #3
glass.dimly commentedChanged priority to normal until it can be ascertained whether or not permissions assignment using Drupal core permissions is affected.
Comment #4
discursives commentedSame here. No issues as yet. Would be nice to 'understand' why this is happening... fago?
Comment #5
brack commentedIn 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.
Comment #6
fagothanks, indeed the code assumed it's the whole permissions page. I've fixed that in 6.x-dev.