- Issue created by @silverham
- Status changed to Needs review
12 months ago 4:51pm 17 July 2023 - last update
12 months ago 8 pass
I update a site from 1.3.0 => 2.1.1.
I run `drush cr` and then `drush updb`
I receive the following error:
> [notice] Update started: system_post_update_entity_revision_metadata_bc_cleanup
> [error] Drupal\sitewide_alert\SitewideAlertStorage does not implement Drupal\Core\Entity\ContentEntityStorageInterface
> [error] Update failed: system_post_update_entity_revision_metadata_bc_cleanup
[error] Update aborted by: system_post_update_entity_revision_metadata_bc_cleanup
[error] Finished performing updates.
I believe this is because the entity type definition is not updated correctly in database after file has been updated.
Workaround via drush (linux/git bash command line):
DRUSH_TEMP_COMMAND=$(cat <<'END'
$key_value = \Drupal::keyValue('entity.definitions.installed');
$key_name = 'sitewide_alert.entity_type';
$entity_type_data = $key_value->get($key_name);
$handlers = $entity_type_data->get('handlers');
$handlers['storage'] = 'Drupal\Core\Entity\Sql\SqlContentEntityStorage';
$entity_type_data->set('handlers', $handlers);
$key_value->set($key_name, $entity_type_data);
END
); ./vendor/bin/drush php-eval "$DRUSH_TEMP_COMMAND"
Update a site from 1.3.0 => 2.1.1.
Add update hook to manually set content storage handler.
Needs review
2.1
Code