Unable to create/edit entity of custom entity type if it is not instance of EditorialContentEntityBase

Created on 13 March 2025, 24 days ago

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) {

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine deimos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024