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.
Problem/Motivation
The form at /admin/structure/workbench-moderation/transitions can set weights from -23 to +23. But the form to edit a single transition state is limited to -10 to +10. Setting a transition greater than +/-10 and then editing the transition causes the value to revert to -10.
Proposed resolution
Set the edit transition form to accept values of -23 to +23.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | wbm-2695543.png | 90.21 KB | balsama |
#6 | 2695543-transition-weight.patch | 2.68 KB | Crell |
Comments
Comment #2
balsamaI put this in the 1.01 sprint: #2698181: [META] Lightning 8.x-1.01 but I suspect we can quickly fix this post RC1 and get it into whatever the next release turns out to be. At a minimum, I suspect we can provide a patch for this next week.
Thanks!
Comment #3
balsamaMoved to RC3 sprint. And I started referencing the issues included in sprints. So you should see the sprint issue in the sidebar now.
Comment #4
itmaybejj CreditAttribution: itmaybejj at Princeton University commentedawesome thanks
Comment #5
balsamaAh - lightning actually isn't touching that form (I thought it was).
Digging a little deeper, it looks like the form at /admin/structure/workbench-moderation/transitions only goes from ±10. But that number is increased when the number of total transitions is greater than 20. At that point, editing an individual transition that has its weight set to >10 or <-10 will result in it being reset to 10/-10.
Comment #6
Crell CreditAttribution: Crell at Palantir.net for Acquia commentedFirst off, what are you people doing that you have more than 20 transitions???
The issue here is that the draggable list weight field is automatic, and always uses negative numbers up to the number of items, so it scales for any number of items. The translation edit form uses the normal weight form element, whose default delta is 10.
The attached patch makes the transition edit form's delta dynamic as well.
Comment #7
balsamaManually tested an confirmed. I created [a ton] of moderations state transitions, dragged one to the top of the list, then clicked "show row weights" and confirmed that the first transition's weight was -12 (as expected). After applying the patch, the edit form for that transition displays -12 as well.
Thanks!
Comment #9
Crell CreditAttribution: Crell at Palantir.net for Acquia commentedSpiffy. Merged!