Problem/Motivation
https://git.drupalcode.org/project/drupal/-/commit/e878713656faabf6d3afd... committed as part of the solution for #2327883: Field [storage] config have incomplete settings until they are saved could introduce a regression that most likely related to Content Moderation and the moderation_state field.
Report 1
I have updated Drupal core from 10.1.8 to 10.2.2. Drush updb is successful but when I do config import I am getting issue for field core.base_field_override.node.content_type_name.promote as below
[error] Error: Call to a member function getSettings() on null in Drupal\Core\Field\FieldConfigBase->getSettings() (line 372 of /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Field/FieldConfigBase.php) #0 /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Field/FieldConfigBase.php(287): Drupal\Core\Field\FieldConfigBase->getSettings()
1 /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(430): Drupal\Core\Field\FieldConfigBase->postCreate()
#2 /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(357): Drupal\Core\Config\Entity\ConfigEntityStorage->_doCreateFromStorageRecord()
#3 /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(1059): Drupal\Core\Config\Entity\ConfigEntityStorage->importCreate()
#4 /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(842): Drupal\Core\Config\ConfigImporter->importInvokeOwner()
#5 /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(663): Drupal\Core\Config\ConfigImporter->processConfiguration()
#6 /home/vsts/work/1/s/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(561): Drupal\Core\Config\ConfigImporter->processConfigurations()
Report 2
We were updated a project from Drupal 10.1.8 to 10.2.7 and clean site install from existing config via drush si -y --existing-config
started to fail with the same backtrace. See the complete backtrace in comment #16.
Steps to reproduce
Report 2 repro steps
- Install a Drupal 10.2.7 site from the recommended project and by using the Standard profile.
- Enable the Content Moderation module.
- Enable the "Editorial" default workflow for the Article content type.
- Install the Base Field Override UI module as a convenient solution for creating base field overrides.
- Modify the Moderation State base field's label to "Foo" on the Article content type at
admin/structure/types/manage/article/fields/base-field-override/node.article.moderation_state
- Export all site configuration via
drush cex
- Modify config/sync/core.extensions.yml and change the install profile from standard to minimal.
- Try to install the site from existing configuration via
drush si -y --existing-config
Proposed resolution
Only run the logic added to \Drupal\Core\Field\FieldConfigBase::postCreate() in the previous commit when a site is not being installed from config.
Remaining tasks
Repro steps and/or...- Test coverage
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Original report by [username]
(Text of the original report, for legacy issues whose initial post was not the issue summary. Use rarely.)