localgovdrupal / localgov

Installation profile for the LocalGov Drupal distribution.
GNU General Public License v2.0
83 stars 19 forks source link

Add an install step so modules can perform tasks at the end of the install process. #750

Open rupertj opened 4 months ago

rupertj commented 4 months ago

This idea comes from the conversation in https://github.com/localgovdrupal/localgov_core/pull/212

If we add a new install step to the LDG profile, and use that to call a hook, we can use that hook in our own modules to perform tasks later in the install process than using hook_install() or hook_modules_installed() would allow.

The specific use case we want this for is to allow localgov_core to install default blocks on behalf of other modules during the installer. If we use hook_modules_installed() for this, it's too early in the install process, and the site's themes aren't set up yet.

Adding our own install step solves this problem by running much later in the install process. The only thing that comes after is downloading translation data.

rupertj commented 4 months ago

This is implemented in PR #751

rupertj commented 4 months ago

If/when this issue lands we could potentially deprecate the hook this PR introduces in favour of the new core hook.