drupalwxt / wxt

Drupal 10 variant of the Web Experience Toolkit (WxT).
https://drupalwxt.github.io
GNU General Public License v2.0
25 stars 27 forks source link

Update 8433 breaks your site if media modules are not enabled #286

Closed spotzero closed 1 year ago

spotzero commented 1 year ago

If you run wxt_core update 8433 without lightning_media or wxt_ext_media installed, some configuration gets created that breaks the site.

The issue is that field.storage.block_content.field_slideshow_items is installed, but since the modules aren't enabled, the field plugins aren't there, which causes the following error on bootstrap:

 [error]  Error: Call to a member function getThirdPartySetting() on null in Drupal\content_translation\ContentTranslationManager->getBundleTranslationSettings() (line 122 of /home/dpascoed/workspace/statcan/sdr-project/site-stc-sdr/html/core/modules/content_translation/src/ContentTranslationManager.php) #0 /home/dpascoed/workspace/statcan/sdr-project/site-stc-sdr/html/core/modules/content_translation/content_translation.module(254): Drupal\content_translation\ContentTranslationManager->getBundleTranslationSettings()

My fix is to first check that at least one of either lightning_media or wxt_ext_media is being used before running the update hook.

sylus commented 1 year ago

Thanks @spotzero for the catch and apologies that you encountered this, i should have considered that case as well.