Cron error due to imcomplete deleted entity

Created on 20 June 2024, about 1 year ago
Updated 24 July 2024, 12 months ago

Problem/Motivation

Here's a bug that's preventing cron running for me, due to a deleted site setting type, that seems to have been deleting before field_purge_batch was run.

Error: Call to a member function get() on null in /var/www/html/web/modules/contrib/site_settings/src/Entity/SiteSettingEntity.php on line 344 #0 [internal function]: Drupal\site_settings\Entity\SiteSettingEntity::getDefaultFieldset(Object(Drupal\site_settings\Entity\SiteSettingEntity), Object(Drupal\Core\Field\BaseFieldDefinition))
#1 /var/www/html/web/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(442): call_user_func('Drupal\\site_set...', Object(Drupal\site_settings\Entity\SiteSettingEntity), Object(Drupal\Core\Field\BaseFieldDefinition))
#2 /var/www/html/web/core/lib/Drupal/Core/Field/FieldItemList.php(169): Drupal\Core\Field\BaseFieldDefinition->getDefaultValue(Object(Drupal\site_settings\Entity\SiteSettingEntity))
#3 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(271): Drupal\Core\Field\FieldItemList->applyDefaultValue()
#4 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(129): Drupal\Core\Entity\ContentEntityStorageBase->initFieldValues(Object(Drupal\site_settings\Entity\SiteSettingEntity), Array)
#5 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(94): Drupal\Core\Entity\ContentEntityStorageBase->doCreate(Array)
#6 /var/www/html/web/core/modules/field/field.module(288): Drupal\Core\Entity\ContentEntityStorageBase->create(Array)
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1685): _field_create_entity_from_ids(Object(stdClass))
#8 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(557): Drupal\Core\Entity\Sql\SqlContentEntityStorage->readFieldItemsToPurge(Object(Drupal\field\Entity\FieldConfig), 50)
#9 /var/www/html/web/core/modules/field/field.purge.inc(83): Drupal\Core\Entity\ContentEntityStorageBase->purgeFieldData(Object(Drupal\field\Entity\FieldConfig), 50)
#10 /var/www/html/web/core/modules/field/field.module(169): field_purge_batch(50)
#11 /var/www/html/web/core/lib/Drupal/Core/Cron.php(335): field_cron()

It looks like field_purge_batch is trying to remove fields from an entity type that no longer exists.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States oknate Greater New York City Area

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

Comments & Activities

Production build 0.71.5 2024