When enabling lightning_media on an existing site, I receive the above error.

Drupal\Core\Config\PreExistingConfigException: Configuration objects (editor.editor.rich_text,       [error]
filter.format.rich_text) provided by lightning_media already exist in active configuration in
/var/www//docroot/core/lib/Drupal/Core/Config/PreExistingConfigException.php:65
Stack trace:

I know there are several other issues with this particular exception but this is different. I have already updated the patch on my system and these entities are different. I think the issue here is that lightning_media shouldn't really enforce this configuration as an existing site would have it (rich text is quite common).

Moving these config files to config/optional allows me to go ahead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hussainweb created an issue. See original summary.

hussainweb’s picture

Status: Active » Needs review
FileSize
466 bytes

This patch fixes the issue. I guess there are more cases where this exception might occur but I will start with what works for us.

miteshmap’s picture

Status: Needs review » Reviewed & tested by the community

The issue occurs when we have configs "editor.editor.rich_text", "filter.format.rich_text" in config directory, before we enable the lightning_media module.
Tested patch on local and it worked fine without any error.
Thanks @hussainweb. :)

balsama’s picture

Thanks for this!

Lightning Media, almost by design, is going to conflict with most existing sites... including those using the Standard profile (which is why we test Media on minimal). So the question becomes which of our config is absolutely necessary for Lightning Media to work, and which is optional. And I tend to agree that using our filter format shouldn't block people from using Lightning Media - although the ability to embed in Rich Text was a big user story to begin with.

If I understand this correctly, the problem I see is that someone who installs Lightning Media on minimal (or with Lightning's profile) will get a different CKEditor configuration than someone who installs on Standard. ...and I can envision a flood of issues in our queue about a "missing" embed button.

If we merge this, maybe we just need to document the differences between installing Lightning Media on Standard vs Lightning or Minimal? Perhaps that could happen on Lightning Media's project page once we fully support using Lightning Media outside of the profile.

hussainweb’s picture

@balsama, your assessment is correct. In our case, we uninstalled Lightning Media and then installed it a bit later. Therefore, it is not as clear cut as just someone deciding to install it later or independent of Lightning base profile.

phenaproxima’s picture

Project: Lightning » Lightning Media
Version: 8.x-3.x-dev » 8.x-2.x-dev
Component: Media » Code
dalin’s picture

Here's a patch that doesn't use rename, so that it can be used with Composer + Composer Patches.

phenaproxima’s picture

Title: PreExistingConfigException: Configuration objects (editor.editor.rich_text, [error] filter.format.rich_text) provided by lightning_media already exist in active configuration » PreExistingConfigException: Configuration objects (editor.editor.rich_text, filter.format.rich_text) provided by lightning_media already exist in active configuration

  • phenaproxima committed cf7a39f on 8.x-3.x
    Issue #2943589 by hussainweb, dalin, balsama: PreExistingConfigException...

  • phenaproxima committed 2c399d8 on 8.x-4.x
    Issue #2943589 by hussainweb, dalin, balsama: PreExistingConfigException...
phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

This passed tests nicely on Travis CI and I think it looks like a useful, non-disruptive change. So, committed and pushed to 8.x-3.x and 8.x-4.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

HerrSerker’s picture

In my case I had to also rename the `embed.button.media_browser` config from install to optional directory