Paragraph access check via parent entity incorrectly uses the default revision of the parent instead of the latest

Created on 1 October 2019, about 5 years ago
Updated 31 May 2023, over 1 year ago

We use revisions and content moderation heavily on node and sometimes owner of the node changes during article updates (node have published default revision + editor works on new version which is not published yet). It makes problem for second user, he is not able to edit the paragraphs he sees the lock icon on the paragraphs. If i check what user gets in ParagraphAccessControlHandler::checkAccess he gets default revision of the node in method getParentEntity() which is not correct... actually on the form he works on different revision and thats the reason he sees lock. Am I alone with this problem and we do have some issue on our project or is it an issue in the module / getParentEntity?

πŸ› Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡ΏCzech Republic mkolar

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡²Armenia le72 Yerevan πŸ‡¦πŸ‡²

    This is still an issue in our project. Any progress here? Patch #17 and/or #19 are looking promising.

  • Status changed to Needs review almost 2 years ago
  • πŸ‡©πŸ‡ͺGermany mrshowerman Munich

    #17 passes test when run against PHP 7.4, so setting back to NR.
    @Artyom Hovasapyan, can you explain your change and also provide an interdiff?

  • The last submitted patch, 19: 3084934-18.patch, failed testing. View results β†’
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Status changed to Needs work almost 2 years ago
  • Our project like this
    1` enable drupal core module workflow (revision levels)
    2` have translator roles (can only translate content)
    3` when I created Node(draft version) and that time translator can not change paragraph(it's OK) but when change draft to In translation that moment Translator can not translate paragraph (It's wrong)
    Thereby I offer change andIf to orIf . It's work correct (for me).

  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    Is loading the latest revision really the solution? Shouldn't the access check load the revision of the parent that this specific paragraph revision is attached to? That's not necessarily the latest revision, is it? I guess for the use case of editing, it is true that the latest revision is what should be loaded. But for viewing, I don't think so. For example, if I'm reviewing an older revision of a node, when the access check is run on the paragraph on that node revision, it should be checking if the user has access to view that specific revision of the node, not the latest revision of that node.

  • Status changed to Closed: duplicate over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    πŸ› Paragraph access check using incorrect revision of its parent, leading to issues editing and viewing paragraphs when content moderation is involved. Needs work is basically the same as this issue, though that one primarily deals with the "view" operation not working right, and this issue deals with the "update" operation not working right. At the root of both is the problem that Paragraphs don't know what revision they are attached to. The latest patches in both these issues is essentially identical, they're both trying to load the latest revision of the parent which is not correct. In any case, I'm going to close this issue as a duplicate so efforts can be concentrated. That issue has more comments & activity and the issue summary is more detailed.

Production build 0.71.5 2024