Closed (fixed)
Project:
Drupal core
Version:
5.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2007 at 03:04 UTC
Updated:
18 Mar 2009 at 19:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
moshe weitzman commentedDries have the exact same patch a +1 at http://drupal.org/node/123705. that one is a dupe of this one. Since Chris, Dries, and I all reviewed this, I set to RTBC.
Comment #2
chx commentedWhile this is useful, this is not adequate to make this function usable. http://drupal.org/node/124727 . Note that this must be backported to 5.x .
Comment #3
moshe weitzman commented@chx - thats a nice feature, but lets not get in the way of this patch. You are overstating the issue when you say that this function is not usable. With this patch i was able to rebuild groups.drupal.org. Without the patch, I wasn't. This patch deserves to go in, and your comment just muddies the water, IMO.
Comment #4
ChrisKennedy commentedCommitted - http://drupal.org/cvs?commit=59253
Comment #5
ChrisKennedy commentedPortable.
Comment #6
chx commentedI am sorry if I muddled the waters -- my comment began with 'this is useful' and just wanted to draw attention to a related issue. groups.drupal.org is a rather small site btw in this context.
I am happy that my muddling have not stopped this issue from being committed and that's a good thing.
Comment #7
drummCOmmitted to 5.
Comment #8
(not verified) commentedComment #9
jlmeredithI may be wrong, but in the description for this bug, I believe that node_access_build() should be node_access_rebuild(). I hunted in the API docs for some time trying to find node_access_build(), lol to no avail. Just a minor change.
Comment #10
ChrisKennedy commentedYes, it was a typo and cannot be changed.
Comment #11
sjs commentedI'm building a site with 80 000 nodes, and the node_access_rebuild_0.patch didn't seem to fix the problems I had with node_access_rebuild. So I wrote a command line script that does (see the attachment). It solves also the following problems:
The rebuild process takes several minutes (at least), and during that time most of the nodes get "permission denied" because of this line run:
db_query("DELETE FROM {node_access} where nid=%d",$node->nid);
So I made the script to delete "per node".
I also got around the php.ini time limit settings by calling the script from command line which has different php.ini than for apache2.
So.. its a bit of a hack, but it does the trick.
Comment #12
enboig commentedMy approach to a similar problem was creating a script which updates just one node each time and using javascript calls himself to update next node. The script is called rebuild_permissions.php:
The output isn't necessary... But I like to know its working.
I already posted it in the mailing list, but I think it may be useful to other users.
Comment #13
chris55 commentedI've been having the same problems and until we've got a server to support drupal 6 I decided on a quicker hack than sjs or enboig: i.e. when it happens, finish the job, don't start again. The code below is designed to be incorporated into a page (with php permissions) that only admins have access to and works with old versions of MySQL. It simply abstracts from the node_access_rebuild() function. If it fails to finish, it could be run again.
Chris
Comment #14
stieglitz commentedThank you Chris for that most sweet script. I have been struggling with this issue for weeks thinking it was a problem with my Db or a configuration problem. The core permissions rebuilder looked as if it was working even though it hung for hours at 90%....after all the documentation said it could take a long time... I loved how easy it was to plug it in a page. I clicked preview and watched it click away! Totally awesome. Thanks again.
Jon
Comment #15
mikhailian commentedSimply beautiful! It is a shame your script is not included in the drupal scripts directory.