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
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | apachesolr-933066-4.patch | 1.01 KB | cpliakas |
Comments
Comment #1
pwolanin commentedSeems like the behavior shoudl be different if there are no node access modules.
Comment #2
pwolanin commentedopening a separate issue for D7: #1007848: Fix apachesolr_nodeaccess for Drupal 7
Comment #3
jpmckinney commentedAdd tag
Comment #4
cpliakas commentedI'm experiencing similar issues. After looking through the code, the call to
node_access_needs_rebuild(TRUE)in Apache Solr'sapachesolr_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. Thenode_configure_rebuild_confirm_submit()function rebuilds the nodeacces permissions and then deletes the variable used to flag whether a rebuild is needed, howeverapachesolr_nodeaccess_rebuild_nodeaccess()callsnode_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
Comment #5
cpliakas commentedMarking as "needs review".
Comment #6
pwolanin commentedfixed via dup issue #1033630: Apache Solr node access broken permissions rebuilding