Problem/Motivation

Currently $entity instanceof RevisionableInterface is used to check if an entity is revisionable to perform appropriate revision-specific tasks. But this leads to trouble, because some entity types (e.g. terms) implment that interface, but aren't revisionable and thus throw errors upon saving panelizer displays.

Proposed resolution

  • Use $entity->getEntityType()->isRevisionable() instead of $entity instanceof RevisionableInterface to determine if revision-specific operations have to be performed

Remaining tasks

  • Create a patch to fix this issue

User interface changes

API changes

Data model changes

Comments

hctom created an issue. See original summary.

hctom’s picture

Status: Active » Needs review
StatusFileSize
new2.02 KB

Here is a patch that uses the proposed solution while preserving the $entity instanceof RevisionableInterface check and combining it with $entity->getEntityType()->isRevisionable().

The check for RevisionableInterface is preserved to allow IDEs to recognize its provided methods (e.g. RevisionableInterface::isDefaultRevision()).

damienmckenna’s picture

StatusFileSize
new2.04 KB

Rerolled.

damienmckenna’s picture

Lets get this into the next alpha release.

  • DamienMcKenna committed 3a37581 on 8.x-3.x
    Issue #2828840 by hctom, DamienMcKenna: Handle entity types that use...
damienmckenna’s picture

Committed. Bumping to the next release.

damienmckenna’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.