Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

system_post_update_entity_revision_metadata_bc_cleanup() fails on updb #143

Open
donquixote opened this issue Dec 14, 2021 · 3 comments
Open

Comments

@donquixote
Copy link

From #141.

When upgrading a website to Drupal 9, with new version of rdf_skos, following the instructions from rdf_skos readme and rdf_entity readme, the following problem occurs in updb:

system_post_update_entity_revision_metadata_bc_cleanup() fails, because "Drupal\rdf_entity\Entity\RdfEntitySparqlStorage does not implement Drupal\Core\Entity\ContentEntityStorageInterface".

Debugging reveals that the exception is thrown in Drupal\Core\Entity\ContentEntityType::checkStorageClass().
At this time, the old definition of rdf_entity entity type is still stored in the key_value table, with its old storage class, which has since been removed.

Of course the "does not implement ..." is slightly misleading, more accurate would be "does not exist".

I wonder what we need to do here.
Some ideas:

  • Provide a stub storage class RdfEntitySparqlStorage extends SparqlEntityStorage to prevent the class-not-found error.
  • In an update or post-update hook: Destroy the entity type, then recreate it using the new storage engine. This would lose stored data.
  • In an update or post-update hook: Convert the entity type to use the new storage engine, while preserving entity data.

The main use case we want to support here is for rdf_skos and oe_content, which unfortunately did not respect the alpha status of rdf_entity. In this use case, the rdf_entity entity type does not really matter. So losing all data in rdf_entity it would be ok?

@donquixote
Copy link
Author

Provide a stub storage class RdfEntitySparqlStorage extends SparqlEntityStorage to prevent the class-not-found error.

Tried this, it does prevent the error from happening!
Not sure what other side effects we need to worry about..

@donquixote
Copy link
Author

Tried this, it does prevent the error from happening!

Just to clarify, I did this without any sparql db configured locally.
Drupal seems to only care about the class existing, not about actual data.

donquixote added a commit to donquixote/rdf_entity that referenced this issue Dec 21, 2021
This prevents error in system_post_update_entity_revision_metadata_bc_cleanup() which runs after the update hooks.
@donquixote
Copy link
Author

The linked PR idimopoulos#7 fixes the problem for me.
However, I don't really have sparql working in my local, and no entities stored there.
It just removes the error on updb from system_post_update_entity_revision_metadata_bc_cleanup().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant