-
-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ generate:entity:content ] 500 Error when deleting a revisionable entity generated by drupal console on Drupal 8.4 #3556
Comments
Can confirm fmfpereira's solutions works, thanks! |
I have almost the same setup but I am using Bundles as well. In this case the
(two times) doesn't work. Instead I need the following:
Thanks for finding this fmfpereira! |
@thuben You're right, i did not try with bundles. Thanks also for finding this. |
Works. |
Works Great !!!. Thank you @fmfpereira and @thuben . |
I can confirm that it works with bundles with the suggested fix. |
Confirm, works for mee too! |
The solution works for me too, also with bundles. It's not necesary to match the instance with RevisionableContentEntityBase class, as proposed by @thuben. In the original code from @fmfpereira an use statement is missing:
|
I was still experiencing an issue when trying to delete an revisionable entity even with this change. This patch solved the error https://www.drupal.org/project/drupal/issues/2924338 |
Problem/Motivation
After Drupal update to 8.4, when trying to delete a revisionable entity created by drupal console the following exception is thrown:
"Drupal\Core\Entity\EntityStorageException: Some mandatory parameters are missing ("console_entity_test_revision") to generate a URL for route "entity.console_entity_test.revision_revert". in Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (line 753 of /var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php)"
Details to include:
How to reproduce
Details to include:
Solution
Method urlRouteParameters on Entity Class is setting the default revision ID for the link relationship type revision.
One possible solution is to override the method and do the same for the revision_revert and revision_delete links.
Update
According to @thuben comment, in some cases the previous code does not work with bundled entities. So he proposes to implement the previous code checking if the entity is an instance of RevisionableContentEntityBase (it works in any cases [with or without bundles] ).
The text was updated successfully, but these errors were encountered: