Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2943589-lightning_media-PreExistingConfigException-7.patch | 6.91 KB | dalin |
#2 | 2943589-2.patch | 466 bytes | hussainweb |
Comments
Comment #2
hussainwebThis patch fixes the issue. I guess there are more cases where this exception might occur but I will start with what works for us.
Comment #3
miteshmapThe 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. :)
Comment #4
balsamaThanks 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.
Comment #5
hussainweb@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.
Comment #6
phenaproximaComment #7
dalinHere's a patch that doesn't use
rename
, so that it can be used with Composer + Composer Patches.Comment #8
phenaproximaComment #11
phenaproximaThis 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!
Comment #13
HerrSerker CreditAttribution: HerrSerker commentedIn my case I had to also rename the `embed.button.media_browser` config from install to optional directory