Active
Project:
Drupal core
Version:
main
Component:
entity system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jan 2024 at 07:04 UTC
Updated:
4 Jan 2024 at 07:05 UTC
Jump to comment: Most recent
The EntityAccessControlHandler::checkAccess has an $entity parameter that should respect the EntityInterface.
Yet in the checkAccess() method there's a call on the $entity object to a method that's not on the EntityInterface:
$entity->isDefaultRevision() && $entity->isLatestRevision()
isDefaultRevision() && isLatestRevision() lives in ContentEntityBase but not in EntityInterface.
This may result in an error :
Call to an undefined method Drupal\Core\Entity\EntityInterface::isDefaultRevision().
Call to an undefined method Drupal\Core\Entity\EntityInterface::isLatestRevision().
Create a custom revisionable entity and add revision ui as defined in Revision UI available to revisionable entities and observe the errors above in AccessControlHandler Class.
We should check if the entity is an instance of RevisionableInterface first in AccessControlHandler Class.
Comments
Comment #2
bhanu951 commented