- 🇺🇸United States beunerd Providence, Rhode Island
@ras-ben @mlncn
First, this function --
workflow_buttons_preprocess_node(&$variables)
-- creates two (not one) optional variables for use in node templates:$current_revision_state
and$latest_revision_state
.Second, why is this "completely redundant"?
Third, as I explained here 🐛 workflow_buttons should only be loaded/load edit form when relevant Fixed in more detail, checking for view display mode by name is arbitrary and may differ between installations.
- 🇩🇰Denmark ras-ben Copenhagen
@beunerd apologies for the slow reply on the other ticket. I dont know why it's flown over my head.
It's quite many months since i created this patch, so i'm trying to remember - but, from reading my comment, it appears that I've missed that there's a second variable being set.
The variable i did notice - latest_revision_state - was not being used for anything, when I searched in the code.
That's why I called it fully redundant.However, when I look in the code, it appears that "current_revision_state" is the same - it's being set, but not being used anywhere. Am i wrong?
Let's continue the discussion on full/viewmode in the other ticket :) https://www.drupal.org/project/workflow_buttons/issues/3328538 🐛 workflow_buttons should only be loaded/load edit form when relevant Fixed
- Status changed to Active
over 1 year ago 1:12pm 2 August 2023 - Status changed to Closed: won't fix
over 1 year ago 3:04pm 2 August 2023 - 🇺🇸United States beunerd Providence, Rhode Island
Thanks, @ras-ben, for the follow up.
but not being used anywhere.
That's correct. This module does not include any twig/template files where the values set in
workflow_buttons_preprocess_node()
would be rendered. The point is to provide those variables to any Drupal theme that wants to use them in their own node-related template. - 🇩🇰Denmark ras-ben Copenhagen
Right, but what would the use case for that be in a template?
It seems overkill to send the data along for no reason, and using a hook in the process - 🇺🇸United States beunerd Providence, Rhode Island
Hmm, so maybe we just move it to the README as an example in case themers want to know?
- Status changed to Needs work
over 1 year ago 4:43pm 2 August 2023 - 🇺🇸United States beunerd Providence, Rhode Island
Actually, I'm realizing this doesn't have any place in workflow_buttons module -- at most it should be added to the core issue queue as a proposal for the workflows core module. It's not related to workflow buttons.
@mlncn What do you think? Is it worth creating a ticket in core for adding the code in this hook? And do you agree we should remove it entirely from this module? And if we do, how do you propose we make sure sites using this module are informed?