Hello,

My Environment
Pressflow Drupal : 6.19
Apache Solr : 6.x1.2 (From the Acquia Drupal Distribution)

I am getting repeated warnings like this " The content access permissions need to be rebuilt. Please visit this page. " . I did a little bit of probing and found that the apachesolr_nodeaccess module was setting node_access_needs_rebuild(TRUE) on line 127 and causing this issue. There are two observations

1. i don't have any node_access module enabled, i checked the node.module implementation of node_access_rebuild() (around line no 2315) and found that it was skipping rebuild if no module implemented node_grants, It instead set node_access_needs_rebuild to FALSE and cleared all the cache.

2. The apache solr node access module implements a form_alter hook like this [line 110]
/**
* Implementation of hook_form_alter().
*/
function apachesolr_nodeaccess_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'node_configure_rebuild_confirm') {
$form['#submit'][] = 'apachesolr_nodeaccess_rebuild_nodeaccess';
}
}

which adds a submit handler to the confirmation form for access rebuild. At this point when the user confirms the rebuild the logic as mentioned in 1 is triggered and then the function apachesolr_nodeaccess_rebuild_nodeaccess is called . In this function there is no check to see if the a rebuild of the index is really required and it again sets the node_access_needs_rebuild to TRUE and hence causing a repeated warning.

I don't know if this is specific to my installation and these are my observations. Kindly correct me if i am wrong and also help in solving this issue

Thanks

CommentFileSizeAuthor
#4 apachesolr-933066-4.patch1.01 KBcpliakas

Comments

pwolanin’s picture

Version: 6.x-1.2 » 7.x-1.x-dev

Seems like the behavior shoudl be different if there are no node access modules.

pwolanin’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

opening a separate issue for D7: #1007848: Fix apachesolr_nodeaccess for Drupal 7

jpmckinney’s picture

Issue tags: +D6

Add tag

cpliakas’s picture

StatusFileSize
new1.01 KB

I'm experiencing similar issues. After looking through the code, the call to node_access_needs_rebuild(TRUE) in Apache Solr's apachesolr_nodeaccess_rebuild_nodeaccess() submit handler doesn't make sense to me in any situation. If the user gets to this point, the system should already be aware that the permissions need to be rebuilt.

Since the Apache Solr submit handler fires after node_configure_rebuild_confirm_submit(), it always causes a situation where the system thinks the permissions need to be rebuilt regardless of whether there are node access modules or not. The node_configure_rebuild_confirm_submit() function rebuilds the nodeacces permissions and then deletes the variable used to flag whether a rebuild is needed, however apachesolr_nodeaccess_rebuild_nodeaccess() calls node_access_needs_rebuild(TRUE) which sets the variable again causing the perpetual call to rebuild the permissions.

It looks like the patch at #1007848: Fix apachesolr_nodeaccess for Drupal 7 removes this line, and I think it would be safe to do so in the 6.x-1.x version of the module as well.

Thanks,
Chris

cpliakas’s picture

Status: Active » Needs review

Marking as "needs review".

pwolanin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -D6

Automatically closed -- issue fixed for 2 weeks with no activity.