diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 1d50f90..b4be137 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1814,21 +1814,17 @@ function system_update_8300() { $storage = $entity_type_manager->getStorage($entity_type_id); // Deal only with content entities that are declaring a 'published' entity - // key and are using the canonical storage. + // key and are using the SQL storage. if (!is_subclass_of($class, ContentEntityInterface::class) || !is_subclass_of($class, EntityPublishedInterface::class) || !is_subclass_of($storage, SqlEntityStorageInterface::class)) { continue; } - $published_key = $entity_type->getKey('published'); - $field_definition = $entity_update_manager->getFieldStorageDefinition($published_key, $entity_type_id); - - // Skip if the 'published' field uses a custom storage. - if ($field_definition->hasCustomStorage()) { - continue; + // Update only if the 'published' field uses the main storage. + $field_definition = $entity_update_manager->getFieldStorageDefinition($entity_type->getKey('published'), $entity_type_id); + if (!$field_definition->hasCustomStorage()) { + // Regenerate entity type indexes, this should add the missed indexes. + $entity_update_manager->updateEntityType($entity_type); } - - // Regenerate entity type indexes, this should add the missed indexes. - $entity_update_manager->updateEntityType($entity_type); } }