I tried to execute a view in the hook_nodeapi (op='insert') which counts how many nodes of the same type already exists. Here I found out that the currently created node is not counted because the author (a simple user) has no access to it.

This is related to the order in which the functions node_invoke_nodeapi() and node_access_acquire_grants() are called inside the node_save() function. I changed the order so that node_access_acquire_grants is called before node_invoke_nodeapi and the bug seems to be fixed.

I dont realy know if it breaks somethig else (but I dont think so). Maybe some one else could check it.

Thanks

Comments

damien tournoud’s picture

Version: 6.17 » 7.x-dev

Agreed on the principle, but we need to fix that in the Drupal 7 branch first, before considering a backport.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.