Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.With the new hooks in #1694792: Allow provision-deploy to move a site to a platform with different module paths, we should be able to implement a registry rebuild before database updates are run. Otherwise, we'll see errors like this when deploying sites onto platforms with modules in different locations:
The following module has moved within the file system: example. In order to fix this, clear caches or put the module back in its original location. For more information, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1128 of /var/aegir/platforms/some_platform/includes/bootstrap.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | hosting_tasks_extra-rebuild_registry_before_updb-2839973-3.patch | 761 bytes | colan |











Comments
Comment #2
colanComment #3
colanI spend hours trying to get this hook implementation to fire, but nothing I tried worked. Here are all of the names I tried:
Anyone know what's wrong?
Comment #4
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedI think that
drush_provision_tasks_extra_provision_deploy_pre_updatedb()should work, since it follows the naming convention used in all other extra tasks.Anyway, it will not work when defined in the "Aegir Hosting Tasks Extra" module, because this hook is fired only in the
deploy.provision.incfile, indrush_provision_drupal_post_provision_deploy(), which is not fired in "Aegir Hosting Tasks Extra" automatically, because here you run justupdatedb. Also, you don't really want to run the fulldrush_provision_drupal_post_provision_deploy()here, hence you will never be able to triggerdrush_command_invoke_all('provision_deploy_pre_updatedb');Maybe this hook should be moved outside of
drush_provision_drupal_post_provision_deploy()to be really re-usable.In fact, I'm not sure if this extra level of abstraction is really needed, since it seems to just add more confusion, and you still need to duplicate some code anyway, to get these hooks fired.
Also, you can't really even access
drush_provision_drupal_post_provision_deploy()from the contrib module, unless you will add this snippet withindrush_provision_tasks_extra_provision_update():I don't think this makes much sense, though..
It is just too much (confusing) work, while all you really need is something like:
It is my pure speculation, so I could be totally wrong, but maybe it helps?
Comment #5
colanRegarding the code above, entity updates should no longer be run automatically (or at all). See #3029042: Add '--entity-updates' when we run database updates (for D8) for details.