Repeated "Illegal offset type..." errors when editing nodes
| Project: | Content Access |
| Version: | 5.x-1.5 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I'm having a problem with content_access: whenever I edit a node -- in particular a content type for which I have set access control settings (e.g., at admin/content/types/my-content-type/access), I'm getting a large number of errors of the form:
Illegal offset type in /var/www/html/pontifices/sites/all/modules/content_access/content_access.module on line 309
That is, the place where the module does "$grants[$rid]['grant_'. $op] = 1;".
I've been able to trace the problem to the value getting returned by the call to content_access_per_node_setting. Instead of it being a simple array of role IDs, it's something more complex (value 3 of this array):
Array
(
[0] => op = view
[1] => nid = 1537
[2] => capns =
[3] => Array
(
[group_post] => Array
(
[author] => author
[4] => 4
)
[forum] => Array
(
[2] => 2
)
[ashoka_nomination] => Array
(
[4] => 4
)
[enterprise_plan] => Array
(
[author] => author
[4] => 4
)
[faq] => Array
(
[2] => 2
)
[group_node] => Array
(
[author] => author
[4] => 4
[3] => 3
)
[resource] => Array
(
[2] => 2
)
[library] => Array
(
[2] => 2
)
[sector_private_page] => Array
(
)
[page] => Array
(
[2] => 2
)
[organization_profile] => Array
(
[author] => author
[4] => 4
)
[bio] => Array
(
[2] => 2
)
[image] => Array
(
[1] => 1
[2] => 2
)
[ashoka_application] => Array
(
[4] => 4
)
[ta_submission] => Array
(
[author] => author
[4] => 4
)
)
)(The content types you don't recognize are, of course, the ones I've defined.)
As I read it, the FOREACH that invokes line 309 is then handing off arrays to line 309 as the supposed rid, which will of course fail, thus causing the errors. My problem, of course, is that I can't figure out why this is happening, and what I should do to fix it.
I realize I'm not offering a lot to go on, but does anyone have a clue what to do here? Thanks!

#1
I'd suggest you to debug content_access_per_node_setting() then. However as no one else has that troubles and 5.x 1.5 is stable for a long time I assume this is somehow a problem of your setup!?