Guardr profile cannot be installed due to use of hook_install()
"drush site-install guardr" fails.
Error -
In install.core.inc line 2287:
[Drupal\Core\Installer\Exception\InstallerException]
Configuration install: guardrThe selected profile has a hook_install() implementation and therefore can
not be installed from configuration.
It appears we need to use the "Allow an install hook in profiles installing from configuration" patch.
https://www.drupal.org/project/drupal/issues/2982052
https://www.drupal.org/project/drupal/issues/2982052#comment-12872437
Add this to composer.json
"drupal/core": {
"2982052 - Allow an install hook in profiles installing from configuration": "https://www.drupal.org/files/issues/2018-11-27/2982052-22.patch"
}
Example failure:
https://travis-ci.com/guardrdistro/guardr-project/jobs/216204039
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | guardr-3071339-4.patch | 732 bytes | shrop |
Comments
Comment #2
joestewart commentedComment #3
shrop commentedNoting that #2357215: Clean up hook_install() in Standard Install Profile may help too. Guardr is using hook_install() code from the standard Drupal profile so once this is cleaned up, we can just pull those changes in, I believe. Sound right, @joestewart?
Comment #4
shrop commentedDescription
Got the error on install Joe mentioned above:
Next steps
Testing steps
* git clone --branch 8.x-1.x git@git.drupal.org:project/guardr.git
* composer install
* Install Drupal using the Guardr profile and confirm no errors result
Comment #5
drupalninja99 commentedAdditional steps I took:
- wget -q -O - https://www.drupal.org/files/issues/2019-08-12/guardr-3071339-4.patch | git apply
- composer update drupal/core
- I removed the from guardr/config/sync folder and removed the sync configuration setting from settings.php after getting a synchronization error (not sure where this gets set?)
- After that guardr installed successfully.
Comment #6
shrop commented@drupalninja99 hypothesizes that the patch for core for this issue is conflicting with the config/sync folder being created by the Drupal Scaffolding. Maybe we can remove that setup from the scaffolding.
Also, we discussed that it might make sense to test and commit #3052298: Update Guardr to core 8.7.0 first and then come back to this so we don't have to update 8.7.0 in testing steps at least.
Comment #7
drupalninja99 commentedAfter applying and committing the Drupal 7 patch to composer/lock I reapplied this patch, ran composer update and it looks like now config/sync is added to the docroot and not until install which means we don't have the problem we had previously. Before there was a README created inside a sync folder within guard/config which was causing the issue. I can confirm that with both updates I can install guardr successfully.
Comment #8
shrop commentedNow that #3052298: Update Guardr to core 8.7.0 has been committed, I think testing this is a bit easier
Comment #9
astrocling commentedI tested this using the following instructions and was able to get the site to install correctly.
Testing steps
* git clone --branch 8.x-1.x git@git.drupal.org:project/guardr.git
* composer install
* Install Drupal using the Guardr profile and confirm no errors result
Based on those testing instructions I believe this is good to go.
Comment #11
shrop commentedDescription
Thanks for all the testing!
I committed the patch
Noting that the same patch is also available in https://github.com/guardrdistro/guardr-project/blob/8.x/composer.json