Problem/Motivation
I have a custom entity type which is instance of RevisionableContentEntityBase. Because I don't need "published" property and related functionality but I need content moderation and scheduler for custom entity type at the same type.
Example,
final class MyCustomEntity extends RevisionableContentEntityBase implements MyCustomEntityInterface {}
As result I get AssertionError: assert($entity instanceof EditorialContentEntityBase) in assert() (line 559 of modules/contrib/scheduler_content_moderation_integration/scheduler_content_moderation_integration.module).
Proposed resolution
In my opinion hook shouldn't break entity save process if some condition isn't met.
My proposal is to replace assert($entity instanceof EditorialContentEntityBase); with if (!$entity instanceof EditorialContentEntityBase) {
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3512832-scheduler_content_moderation_integration-assertion_error.patch | 837 bytes | deimos |
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3512832-unable-to-createedit
changes, plain diff MR !82
Comments
Comment #3
deimos commentedI will provide a proposed solution.
Comment #4
deimos commentedCommitted fix as described in the proposed solution.
Please review.
Comment #5
deimos commentedAttach a patch file with the same fix to use on my site and don't be dependent from MR and for others to get quick fix if they face the same issue.
Comment #8
smustgrave commentedI'm fine with this change, thanks!