I'm trying to disable the Shortcut module on my site (which uses Configuration Management/core CMI for configuration deployment), but due to the way BLT runs it's tests in a clean environment, using the Lightning install profile, the Shortcut module is always enabled, and there are two entities created by Lightning which cause config-import to fail:
Import the listed configuration changes? (y/n): y
Drupal\Core\Config\ConfigImporterException: There were errors [error]
validating the config synchronization. in
Drupal\Core\Config\ConfigImporter->validate() (line 728 of
/home/travis/build/acquia-pso/project/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php).
The import failed due for the following reasons: [error]
Entities exist of type <em class="placeholder">Shortcut link</em> and
<em class="placeholder"></em> <em class="placeholder">Default</em>.
These entities need to be deleted before importing.
I'd like to propose removing those two entities from the default install. They could be added elsewhere somehow, but since they're part of the core install, this means you can't have automated clean install processes (e.g. using CMI, Drush with a force install, etc.) that import configuration without the Shortcut module enabled.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2834874-3-remove-shortcuts.patch | 1.07 KB | geerlingguy |
Comments
Comment #2
geerlingguy CreditAttribution: geerlingguy commentedComment #3
balsama+1 from me. We took this pattern from core's standard profile: https://github.com/drupal/drupal/blob/8.3.x/core/profiles/standard/stand...
If users really want prepopulated shortcuts, we can consider re-adding them as an optional subcomponent of lightning_core.
Comment #4
geerlingguy CreditAttribution: geerlingguy commentedPatch attached.
Comment #5
phenaproximaOne possible option is to export both shortcuts as config entities and package them in config/optional so they won't be installed if Shortcut isn't.EDIT: I take it back. Shortcuts are content entities. However...we could simply wrap that code in a
moduleExists('shortcut')
check... ;-)Comment #6
balsamaTravis is happy: https://travis-ci.org/balsama/lightning/jobs/183641260
I left the patch as-is. That is, Lightning still installs Shortcut. I figured some builds might depend on that and I don't want to break them. It is a little weird to have a link to shortcuts in the tool bar which leads to an empty submenu. But the Shortcut module does a pretty good job explaining how to add them... and we still give all authenticated users access to shortcuts.
Anyway, I could see other users wanting to uninstall Shortcut, and I think unblocking that takes precedent.
re @phenaproxima, unless we provided a way to not install shortcut before lightning.install ran, the shortcut contents would still always be created. (and prevent people from uninstalling)
Comment #9
balsamaThanks!
Comment #10
geerlingguy CreditAttribution: geerlingguy commentedThank you! And yeah, no issue with having it installed by default—that's similar to Standard profile, and some people definitely do use Shortcut. As long as it's not impossible to disable, I'm happy :)
Comment #11
phenaproxima