- 🇺🇦Ukraine mykola dolynskyi Poltava
https://www.drupal.org/project/drupal/issues/3031271#comment-13706800 ✨ Support version negotiation for any entity type (currently only Node & Media are supported) Fixed
@lois.chabrand , @PQ - thank you very much, with small changes that works good to drupal 9.5.2
- 🇺🇦Ukraine mykola dolynskyi Poltava
update to https://www.drupal.org/project/drupal/issues/3031271#comment-14884943 ✨ Support version negotiation for any entity type (currently only Node & Media are supported) Fixed - it was working good, until we deleted some nodes which share the paragraph
afterthat we getting
Error: Call to a member function getEntityType() on null in Drupal\jsonapi\Access\EntityAccessChecker>checkRevisionViewAccess() (line 249 of web/core/modules/jsonapi/src/Access/EntityAccessChecker.php)
switch ($entity_type->id()) { case 'node': case 'media': $access = $entity->access('view all revisions', $account, TRUE); break; // Project-specific modification... Allow access to revisions of paragraphs // if the current user has access to the parent entity and to this // version of this paragraph. Note, this is not a perfect implementation. // Ideally we should be checking for access to the specific version of the // parent entity but there appears to be no way to do that with // information available at this point until // https://www.drupal.org/project/paragraphs/issues/2954512 is committed. case 'paragraph': assert($entity instanceof ParagraphInterface); $parent = $entity->getParentEntity(); // Parent became grand parent while ($parent->getEntityType()->id() === 'paragraph') { $parent = $parent->getParentEntity(); // <--------- line 249 }
- 🇺🇦Ukraine mykola dolynskyi Poltava
adding patch which overcomes https://www.drupal.org/project/drupal/issues/3031271#comment-15257741 ✨ Support version negotiation for any entity type (currently only Node & Media are supported) Fixed
It basically ignores parent part of access check if parent is null