- πΊπΈUnited States beunerd Providence, Rhode Island
@ras-ben, @mlncn
Sorry just getting to this now. Please help me understand what the problem is here, because I don't see it! And I think the fix that was merged in disables some of the module's intended flexibility and utility.
The first of the hooks mentioned in the issue description (
hook_entity_view()
) is there to show the workflow buttons if they're included in the list of enable components for the node type / view mode loaded. We shouldn't be hard-coding a restriction here for some particular view mode with an arbitrary machine name. That restriction is handled by the view mode's configuration itself. Perhaps we need to add the workflow buttons to the list of disabled components for all workflows by default and let users "opt in" to including them on the various node views, but that preserves the flexibility here. This is not so different from enabling comments on a node type.The second of the hooks mentioned (
hook_preprocess_node()
) passes the latest revision workflow state to the node template. That's it. True, it does do an extra load of the $node object to get a list of its revision ids, but there's no rendering or anything heavy going on here.What am I missing here?
- πΊπΈUnited States beunerd Providence, Rhode Island
@ras-ben, @mlncn
I think the comments above address the first proposed feature, and regarding the second ("A check, to make sure that the user actually has permissions to use workflows - so we can avoid heavy operations for anonymous users.") that's already handled by Drupal's standard access methods. If an anonymous user can use a transition in the content moderation permissions collection, then they can see the buttons; if they do not have those permissions then the buttons do not appear for them. Again, I might be misunderstanding the problem.
-
beunerd β
committed b45f5d09 on 8.x-1.x
Revert "Issue #3328538 by ras-ben, mlncn: workflow_buttons should only...
-
beunerd β
committed b45f5d09 on 8.x-1.x
- Status changed to Closed: works as designed
over 1 year ago 10:22pm 1 August 2023 - πΊπΈUnited States beunerd Providence, Rhode Island
@ras-ben, @mlncn
I'm going to revert this change per the explanation above.
- π©π°Denmark ras-ben Copenhagen
Sorry for the slow reply, Beunerd.
You have a good point, in regards to view mode. However, I think it should most definetely be a "opt in" view mode, as otherwise, there's a massive performance issue.
In regards to the anonymous-user-avoid-bla-bla - yes - you're right, and my comment was irrelevant.
- Status changed to Fixed
over 1 year ago 3:20pm 2 August 2023 - πΊπΈUnited States beunerd Providence, Rhode Island
@ras-ben
Thanks, that's a good idea. I've added a commit to the 8.x.-1.x branch. Marking this as fixed.
Automatically closed - issue fixed for 2 weeks with no activity.