Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I dont know why, but I cannot run the rebuild permissions in post settings. When I select rebuild permissions, it appears to be loading for a second, then goes to the node settings page. No permissions rebuild done.
Also, this may or may not be related, the update.php goes straight to the frontpage when I am at the point of starting the updated of the database.
I use drush to get around issues with slow response and update.php, but do not have a command line work around for rebuilding permissions. Ideas?
Comments
Comment #1
Netzarim CreditAttribution: Netzarim commentedAlso, while troubleshooting this issue, I found that the node_access table gets truncated when I run the rebuild in the web interface and then it dumps back to the other page...
At least that tells me that it is actually in the process when something goes bad..
Is there some temp folder or something that it needs to write to? I am not seeing anything in syslog, apache, or in the drupal watchdog logs indicating what the problem is. It is very frustrating..
I build a clean 6.12 dev site, installed the modules... When I installed FriendList, the problem showed up there too... I uninstalled friendlist and the problem stays..
Comment #2
okokokok CreditAttribution: okokokok commentedTo rebuild permissions from the command-line: install drush and try
Comment #3
koppie CreditAttribution: koppie commentedWorks for me too, with D7. Thanks for the tip!
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedworked on drupal 7.16. Thanks Kasper Souren, big help!
Comment #5
dafederI've created this drush extention to do this as a batch job on D7 - just running the php command times out on larger sites:
https://github.com/dafeder/node_access_rebuild
Comment #6
jduhls CreditAttribution: jduhls commentedKudos @dafeder for https://github.com/dafeder/node_access_rebuild
Works great!
Comment #7
tapas_talukder CreditAttribution: tapas_talukder commentedDrush command drush php-eval 'node_access_rebuild()'
Comment #8
chOP CreditAttribution: chOP at Deloitte Digital commentedFor Drupal 8.4 this function still exists. So the Drush command method also still works:
Comment #9
ressa CreditAttribution: ressa at Ardea commentedThanks @Tapas Talukder and @chOP, and it still works in Drupal 8.5.0.
Comment #10
mogtofu33 CreditAttribution: mogtofu33 at Catalyst IT commentedThere is a Drupal console command for Drupal 8.x : drupal node:access:rebuild
Comment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThere is another module for that!
https://www.drupal.org/project/node_access_rebuild_progressive
Comment #12
swatee_karpe CreditAttribution: swatee_karpe commentedHi Guys,
I also tried below command mentioned in #8 for my 8.7.8 drupal version. but it is not working though it shows "rebuilt successfully".
do we need to do special setting in drush?
# drush php-eval 'node_access_rebuild();
I am following below steps:
- i am migrating some CSV data using migration module into the site.
- after that nodes get import and we need to rebuild the permission to get added data visible to the normal viewer.
- we have default drush is installed on server
- I am running "drush php-eval 'node_access_rebuild();' " using SSH but data not get reflect on site.
- instead i used admin panel and status page link to rebuild node permission it works well.
But here i wanted to run some script at the backend so need to add above command in script but not working.
Any clue, why is not working? Did I missing any steps here.
Please guide.
Thanks in advance.
Comment #13
ressa CreditAttribution: ressa at Ardea commentedWhich Drush version are you using?
Comment #14
swatee_karpe CreditAttribution: swatee_karpe commentedHi Ressa,
i am using Drupal 8.7.8.
Comment #15
swatee_karpe CreditAttribution: swatee_karpe commentedHi Ressa,
I am using drupal 8.7.8.
Comment #16
ressa CreditAttribution: ressa at Ardea commentedNot Drupal, Drush :-)
Comment #17
swatee_karpe CreditAttribution: swatee_karpe commentedOhh sorry,
It's Drush version : 9.7.1
Comment #18
ressa CreditAttribution: ressa at Ardea commentedYou could try updating to the latest version 9.7.2 or even Drush 10? Have you tried running the command with extra verbosity, by adding
-vvv
?