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.

CommentFileSizeAuthor
#4 2834874-3-remove-shortcuts.patch1.07 KBgeerlingguy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geerlingguy created an issue. See original summary.

geerlingguy’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
balsama’s picture

+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.

geerlingguy’s picture

Status: Active » Needs review
FileSize
1.07 KB

Patch attached.

phenaproxima’s picture

One 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... ;-)

balsama’s picture

Status: Needs review » Reviewed & tested by the community

Travis 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)

  • balsama committed cca05d1 on 8.x-2.x authored by geerlingguy
    Issue #2834874 by geerlingguy: Remove default Shortcuts configured in...

  • balsama committed bef0fcf on 8.x-1.x authored by geerlingguy
    Issue #2834874 by geerlingguy: Remove default Shortcuts configured in...
balsama’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

geerlingguy’s picture

Thank 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 :)

phenaproxima’s picture

Status: Fixed » Closed (fixed)