Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294805

Call to a member function getSettings() on null in Drupal\Core\Field\FieldConfigBase->getSettings()

$
0
0

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

  1. Install a Drupal 10.2.7 site from the recommended project and by using the Standard profile.
  2. Enable the Content Moderation module.
  3. Enable the "Editorial" default workflow for the Article content type.
  4. Install the Base Field Override UI module as a convenient solution for creating base field overrides.
  5. 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
  6. Export all site configuration via drush cex
  7. Modify config/sync/core.extensions.yml and change the install profile from standard to minimal.
  8. 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.)


Viewing all articles
Browse latest Browse all 294805

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>