The widget to allow scheduling of workflow transitions is allowing a user to choose options that are not actually configured transitions.
For instance, in my Workflow configration, I have no Draft -> Archived transition.
Yet, a user can schedule a Draft -> Archived via this widget, and it's somewhat hidden why it doesn't work when a user schedules it in this manner.
In an ideal world, the options in the widget should be the same workflow transition options in the standard Content moderation dropdown (shown above this module's widget), that takes into account the configured workflow states and transitions, and user permissions for using those transitions.
At the very least, perhaps some error handling or explanation of why the scheduled content isn't actually transitioning, because it's trying to perform an action that can't be done because there isn't a transition actually configured for it.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | lightning_scheduler-take_workflow_transitions_into_account-3115218-2.patch | 1.13 KB | nord102 |
| Screen Shot 2020-02-21 at 3.56.03 PM.png | 154.56 KB | joshua.boltz |
Issue fork lightning_scheduler-3115218
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nord102I have created a patch, which takes some inspiration from how the transition is currently being validated. I think it makes more sense to limit the list based on the available Workflow transitions as opposed to listing all moderation states and validating it after the fact.
Comment #4
andrew.martin commentedThis is great, thank you!
We did find one issue with this patch. We have a simple workflow - Draft -> Published -> Archived. If the user creates a new content item, publishes it and schedules it to archive. Then changes the content back to a draft. The scheduled transition remains, but it's know hidden as it's an invalid transition. If the user edits and tries to save the content, they cannot and just receive an unclear error message about the date being invalid.
Comment #5
deviantintegral commentedIt also looks like the module permissions are being ignored. I currently only have two transitions enabled for a role, but the widget is allowing me to save any transition.
Comment #7
kristiaanvandeneyndeThe main issue I see is that the widget is 100% frontend instead of using Drupal's AJAX system. Because of that, this patch will limit the scheduling to only the immediate next state.
Let's say you have Draft -> Published -> Unpublished and the item is currently in Draft.
Now, if the module were to use AJAX, we could only show the available states for the current state or the currently scheduled state if there is one. If you then delete any scheduled state other than the last one, all scheduled states after that should be deleted also to avoid impossible transitions being scheduled.
Comment #8
joseph.olstadtriggerred tests on mysql D9.2
instead of postgres D8.9
Comment #9
kaszarobertNeeds a reroll. Also, when adding multiple transitions, this would limit editors as the list will contain only the next valid transition from the current node state. It would be awesome if the UI would enable users to select valid next states only even if multiple transitions are added.