Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My webpage uses i18n, and there is additional translate tab on node pages. When you try to access it, when no translations exists yet for the node, the following warning occurs:
Illegal offset type in isset or empty in nodeaccess_userreference_field_settings() (line 388 of (...)/sites/all/modules/nodeaccess_userreference/nodeaccess_userreference.module).
Comments
Comment #1
mariusz.slonina CreditAttribution: mariusz.slonina commentedThe warning raises when nodeaccess_userreference_node_access() is called from node_access in i18n/i18n_node module (i18n_node.pages.inc line 81). If I change
to
the warning goes away. Is it the issue of the nodeaccess_userreference or i18n?
Comment #2
danielb CreditAttribution: danielb commentedHmm this might have to do with some recent additions regarding 'create' functionality. I need to debug the workflow of that.
Comment #3
danielb CreditAttribution: danielb commentedActually I think i18n is doing the wrong thing. It is calling node_access('create', $node) rather than node_access('create', 'node type');
Not sure they're allowed to do that :/
Comment #4
mariusz.slonina CreditAttribution: mariusz.slonina commentedI will mark this for now as duplicate, I posted separate issue on i18n queue #1262800: node_access in i18n_node: ('create', $node) or ('create', $node->type) or ('update', $node).
Comment #5
kdub CreditAttribution: kdub commentedI've also has this issue. But it appears to be site wide. If I preview any newly created node, I receive that same "Warning: Illegal offset type in isset or empty in nodeaccess_userreference_field_settings()" above my previewed content. I'm on D7.8
Comment #6
hbergin CreditAttribution: hbergin commentedkdub, I was just debugging the same issue you're having when I saw your post. I'm using D7.9. I've only seen the error when:
Comment #7
hbergin CreditAttribution: hbergin commentedAs a workaround, I've made the following edits to the module file at line 387 for me, which seem to stop the error being displayed, with no side effects I can see.
Comment #8
kdub CreditAttribution: kdub commentedThank you hbergin. That did the trick!
Comment #9
Jaapx CreditAttribution: Jaapx commentedSolution also works for me in today'sdev version of the module (to be patched in line 424). The problem occured with preview on for the nodetype.
Comment #10
adelka CreditAttribution: adelka commentedGreat solution! Thank you!
Comment #11
ryoken CreditAttribution: ryoken commentedDitto hbergin, and thank you for identifying the problem and providing the workaround - I've been pulling my hair out until I came across your post. For the record, I'm currently running D7.14 with NAUR 7.x-3.8 (but don't have any internationalisation modules installed).