fix: #3090200 Paragraph access check using incorrect revision of its parent

Problem

Under content moderation, or after a revision revert, paragraph access is checked against the default revision of the parent — not the revision the paragraph actually belongs to. This blocks editing/viewing the affected paragraphs.

Fix

For non-view operations, resolve the parent's latest translation-affected revision before running the parent access check. Builds on the existing library-item access handling; library-item and view behaviour are unchanged.

src/ParagraphAccessControlHandler.php (+34/−3):

  • Inject entity_type.manager.
  • Load the latest revision via TranslatableRevisionableStorageInterface::getLatestTranslationAffectedRevisionId() and check access against it.

Alternative to !198 (revision-walk approach) — defer to maintainers on which lands. Credit to acbramley and bstallings for !198 and the prior work.

Verified at runtime on Drupal 10.6 / PHP 8.4.


AI-Generated: Yes (used Claude Code to re-roll the earlier 3084934-13_combine_3090200-22 approach onto current 8.x-1.x). Logic reviewed and runtime-verified by the contributor, per the Drupal AI policy.


Checkpoints

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Documentation
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release Notes
  • Release
Edited by Rajab Natshah

Merge request reports

Loading