Invalid config after running y_lb_article_update_91004

Created on 6 May 2025, about 1 month ago

Problem/Motivation

Hi, thanks for all your work on the distribution! I recently ran an upgrade and after running the database updates and exporting config, an attempt to reimport the config failed due to validation errors. I've worked around it on my site, so this isn't blocking our upgrade, but I wanted to escalate it.

Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
Configuration core.entity_form_display.block_content.articles_listing.default depends on the field.field.block_content.articles_listing.field_article_type configuration that will not exist after import.
Configuration core.entity_view_display.block_content.articles_listing.default depends on the field.field.block_content.articles_listing.field_article_type configuration that will not exist after import. in Drupal\Core\Config\ConfigImporter->validate() (line 814 of /var/www/html/web/core/lib/Drupal/Core/Config/ConfigImporter.php).

In ConfigImportCommands.php line 290:
The import failed due to the following reasons:
Configuration core.entity_form_display.block_content.articles_listing.default depends on the field.field.block_content.articles_listing.field_article_type configuration that will not exist after import.
Configuration core.entity_view_display.block_content.articles_listing.default depends on the field.field.block_content.articles_listing.field_article_type configuration that will not exist after import.

In ConfigImporter.php line 814:
There were errors validating the config synchronization.
Configuration core.entity_form_display.block_content.articles_listing.default depends on the field.field.block_content.articles_listing.field_article_type configuration that will not exist after import.
Configuration core.entity_view_display.block_content.articles_listing.default depends on the field.field.block_content.articles_listing.field_article_type configuration that will not exist after import.

As far as I can tell this is because the update adds config that references the field field_article_type, which doesn't have any storage defined if you haven't enabled the lb_related_articles_blocks module.

Steps to reproduce

I think this should work:

  1. install the distro with y_lb_article 1.2.20 and without enabling lb_related_articles_blocks.
  2. upgrade to the latest
  3. export config

Proposed resolution

I guess either require the module, move the field storage definition, or support not having the field.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom AndyF

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AndyF
  • πŸ‡ΊπŸ‡¦Ukraine SVICER Mirgorod

    Yep it’s look like dependency missing after this https://www.drupal.org/project/y_lb_article/issues/3489245 πŸ“Œ Article listing should allow filtering by type Active
    I see that `lb_related_articles_blocks` is dependency only in small_y profile inside `small_y_articles` module. Other case it `lb_related_articles_blocks` enabled during instalation on new sites and I do not see hook_updates to enable this module. So I think we should just enable this module in this hook before import configs.

  • πŸ‡ΊπŸ‡¦Ukraine SVICER Mirgorod
Production build 0.71.5 2024