Not sure why activity would be a culprit of this, but non admin users see this error when viewing default activity view or any other acitivity views created. This error will also occur on a page when the view is a block.

Notice: Undefined index: table in _node_query_node_access_alter() (line 3197 of /var/sites/my/modules/node/node.module).
Notice: Undefined index: table in _node_query_node_access_alter() (line 3197 of /var/sites/my/modules/node/node.module).
Notice: Undefined index: table in _node_query_node_access_alter() (line 3197 of /var/sites/my/modules/node/node.module).
Exception: Query tagged for node access but there is no nid. Add foreign keys to node.nid in schema to fix. in _node_query_node_access_alter() (line 3218 of /var/sites/my/modules/node/node.module).

Comments

JGonzalez’s picture

Additional information:

This is being caused by adding the 'Activity:Node' relationship to my view.

aacraig’s picture

Any update on this? I see the same error on a fresh installation of Activity.

selfsimilar’s picture

I'm also seeing this, but with a different line number.
Notice: Undefined index: table in _node_query_node_access_alter() (line 3195 of modules/node/node.module).

And I'm seeing one notice for each activity entry that won't show up, which are events with hooks to User Login and User Logout. But the messages for "Node Insert" is showing fine, w/o error.

Same version of Activity as above, running on Drupal 7.10

krisgraham’s picture

Same issue here - subscribing

Snakey_P’s picture


Notice: Undefined index: table in _node_query_node_access_alter() (line 3195 of /modules/node/node.module).

I am getting the same. I think it is mainly due to the log out hook, as I got six of these, representing six logouts. I have now deleted the logout activity and have not had anny more errors appear, but the ones that are there are not going away.

Any help would be greatly appreciated.

javdich’s picture

Also having this error. Agree it may be a problem with adding the 'Activity:Node' relationship to a view.

Routh’s picture

Having the same issue. Only with anonymous users, and another line number: 3228

Notice: Undefined index: table in _node_query_node_access_alter() (line 3228 of /var/www/drupal7/modules/node/node.module).

adf1969’s picture

StatusFileSize
new723 bytes

The issue is that activity is not implementing the foreign keys setting correctly in schema. (see: http://api.drupal.org/api/drupal/includes%21database%21schema.inc/group/...)
The attached patch fixes it for me.

raphaelhuefner’s picture

StatusFileSize
new1.66 KB

Re-roll patch from #1292760-8: Causes undefined index _node_query_node_access_alter with the better foreign key definition format, but now for all tables defined in activity_schema()

_shy’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.