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.
Hello,
I love this "module". Saved me many times on my drupal 7 sites. Mostly on test sites where I'm screwing around, but still!
I have a question that might expose me as incredibly ignorant or might just have a simple answer: How do I rebuild the registry and remove extra entries in Drupal 6? Does the dtools WSOD "module" do that?
Feel free to answer abruptly and mark this as "Fixed/stupid" :)
Comment | File | Size | Author |
---|---|---|---|
#7 | registry_rebuild.d6_version_1307864_07.patch | 3.28 KB | rfay |
#5 | registry_rebuild.d6_version_1307864_05.patch | 2.87 KB | rfay |
#2 | registry_rebuild.support_d6.patch | 1.97 KB | rfay |
Comments
Comment #1
rfayOn D6 all that really happens is that the paths in the system table get messed up. You can manually fix the ones that are broken (and blocking you from bootstrapping) and get past that, then do a cache clear or visit the modules page for the rest.
A backport to D6 should be pretty easy; really the drush command ought to go into drush itself and be sensitive to whether it just has to do the system table or also the class registry (D7).
Comment #2
rfayThe key need in D6 is to rebuild the module cache.
In the bad old days, drush could accidentally download a copy of Drupal into sites/all/modules (or this could happen some other way) and then drush updatedb would make all those system modules get put into the system table. *Then* the poor user discovered it and deleted sites/all/modules/drupal... and their site came to a grinding halt.
So drush rr with this patch on d6 now will solve this, but there's one problem.
Although we have
in there to prevent hook_init() from being invoked, it is not actually being set in time to prevent hook_init(). I can't figure out what the magic is to do that. It's actually pretty important, and could be the cause of some of the #fails we have occasionally seen (feeds?). I think because we aren't setting that in time, hook_init() is happening... and hitting some fail.
Comment #3
jonhattanPerhaps it works if bootstrap is postponed untill the define is done ?
1. in the command definition
2. in the command callback
this kind of "soft-bootstrap" is also done in command core-directory.
Comment #4
rfayThanks so much! I look forward to trying this out.
Comment #5
rfay@jonhattan I very much appreciate your help. More? :-)
I haven't gotten hook_init() not to fire. Here is with watchdogs in hook_init, and with the attached patch, which specifies bootstrap as you suggested. Note that hook_init() still gets invoked before the command is ever called.
Comment #6
jonhattanThere's a bootstrap error, not printed in any way, generated by
drush_enforce_requirement_core($command);
in drush.php:This is probably an incongruence in drush:
In DRUSH_BOOTSTRAP_DRUSH phase, drush can't fullfill the 'core' requirement. So get rid of 'core' requirement and you're done :)
Comment #7
rfayDing Ding Ding! @jonhattan wins the prize. Thanks!
This seems to work fine for D6, and I think it will resolve some D7/8 problems as well.
Comment #8
jonhattanHavent tested it but looks good. Perhaps it worth testing
drush @alias rr
Comment #9
rfayCommitted with one additional detail: A quick TRUNCATE {cache} before the registry rebuild, which fixes #1324000: Failed to rebuild registry on PDO Exception: duplicate entry and #1366094: CTools breaks the registry rebuild
http://drupalcode.org/project/registry_rebuild.git/commitdiff/047af8f
This is now in the dev release; I'd appreciate any test results