Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
i think it will be useful for admin to optionally provide labels for each transition. this could be done on a new admin page. the labels would be shown as links on a node and they would usually be verbs like 'reject' which describes the review => rework transition. these same links could show up in Views table listings. the destination of those links would be the workflow tab with the right destination state selected in the radio button. then all that is needed is to add a workflow comment and click submit.
Comment | File | Size | Author |
---|---|---|---|
#26 | Transition.png | 9.91 KB | preddy |
#24 | workflow_admin_ui.page_.labels.inc_.patch | 704 bytes | preddy |
Comments
Comment #1
jvandyk CreditAttribution: jvandyk commented+1 for transition labels. This is a must for workflow-in-core-in-5.0.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedjvd or other - any comment beyond what i mentioned about where these labels should be used?
Comment #3
jvandyk CreditAttribution: jvandyk commentedMost workflow systems use the transition labels as labels for buttons that execute the transition.
In thinking about a very basic default workflow and UI for Drupal, I like the idea of comments not enabled by default, and clicking on the button executes the transition. That's about as simple as it gets.
For advanced workflows we could enable commenting and the workflow tab.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedthanks ... consider the 'published' checkbox on the node form in drupal core. if we turn that into a button, then how does that interact with the saving of the whole node form? i'm having some trouble visualizing how that will work. in some ways, the current mechanisms (checkbox in core, radio buttons for states in workflow) fit in better than buttons.
Comment #5
MrTaco CreditAttribution: MrTaco commentedi've already implemented this if anyone would like the code
Comment #6
jvandyk CreditAttribution: jvandyk commentedAttaching a patch here would be nifty.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commented@MrTaco - plase provide patch if possible
Comment #8
ntt CreditAttribution: ntt commentedsubscribing
Comment #9
deekayen CreditAttribution: deekayen commentedI got MrTaco's code and made a patch, but didn't see this issue and put it at #227038: Add named transition states. Then I apparently made an even bigger mess by making http://drupal.org/project/workflow_named_transitions. There are some bugs in it and I am working through them, but is this something I should be working back into core workflow or is it better off an a separate module?
Comment #10
jvandyk CreditAttribution: jvandyk commentedI'd like to see it in core workflow, even if it's not required by default (requiring named transitions makes configuration tedious for basic workflows).
Comment #11
myshkin CreditAttribution: myshkin commentedIf could have a 'next' or 'default' transition that would go to the next node if it hadn't been created, but could be overridden if that transition had been explicitly defined. The caveat being that I would want to be able to force the 'next' transition to return to the same state so that I could put my Error states after the completion states and not worry about a default transition moving into the error state.
Comment #12
Monzer Emam CreditAttribution: Monzer Emam commentedTransition labels from POV is important as it should achieve the following :
And more worst in each cell all roles will be there (really Something not desirable).
But Using labels in workflow with 8 stats (normaly will be in it less than 15 transition) so this will result in table with 2 columns only with 15 rows (Simpler to read and work with).
Comment #13
RdeBoerI've released a module that builds on the lovely "Workflow Named Transitions" module (without being dependent on it). It takes the concept one step further to get rid of the radio buttons altogether, replacing them by single action submit buttons.
See Workflow extensions
Comment #14
Bastlynn CreditAttribution: Bastlynn commentedThis seems UI related and button related and generally a good idea once other issues are resolved. Saving this one in the queue for now.
Comment #15
Bastlynn CreditAttribution: Bastlynn commentedBumping this up to 7.x to be backported to 6 once finished in 7.
Comment #16
NancyDruI'm in favor of leaving this in Workflow Extensions unless Rik wants to become a maintainer here and merge it.
Comment #17
RdeBoerRik doesn't feel like becoming a maintainer of Workflow -- too much work!
Rik
Comment #18
NancyDruYeah. Please remind me, why did I become one?
Comment #19
RdeBoerBecause you're doing a great job, Nancy!
Massive efforts, first by Bastlynn and now you.
We're all eagerly awaiting 7.x-1.1 becoming official...
Rik
Comment #20
johnvRe-opening this:
- Workflow Extensions is not compatible anymore with 7.x-2.x
- Workflow Named Transitions is not compatible anymore with 7.x-2.x
See #867186: [EXPORTING] Add machine names to workflows and workflow states for adding machine names.
Comment #22
johnvWow, a five-digit issue can now be closed.
I've taken the code from workflow_named_transitions, and added it to this module.
It required:
- one extra field in the workflow_transitions table;
- one extra page in workflow_admin_ui;
- few lines in WorkflowState->getOptions;
The patch is rather big, but includes some re-organizing of files.
It does not include token support from workflow_extensions. See #2249211: Add token support for Transition labels.
Comment #24
preddy CreditAttribution: preddy commentedTransition label UI form do not display data under 'from' state column except for first row.
Attached patch resolved for me. Could you please check if this is fine.
Comment #25
johnvThis was done on purpose for better UI. I set first column on change of from-state. Else you have a long list en get lost .
Do you think the data is wrong after this explanation?
Comment #26
preddy CreditAttribution: preddy commentedcondition $old_state == $new_state returns false as they are different states and print '' from second row on wards..
Attached screen shot with data issue.
Comment #27
johnvAh, you must save the transitions first. Until now the stayOnThisState was not saved. Now it is but you must resave them .
This needs an update hook or help text.
[EDIT] After our private conversation, it shows that update.php did not run, yet.
Comment #28
preddy CreditAttribution: preddy commentedAgree with comment in #25 and patch in #24 is not required. Thanks.
Comment #30
johnv