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 cannot reorder the conditionals. Before I save, they appear OK, but after I save, they are always the old order.
And "show row weights" does not show anything, instead it just hides the move arrows.
Comment | File | Size | Author |
---|---|---|---|
#6 | webform_conditional_weights.patch | 5.56 KB | quicksketch |
#5 | 1627656-5-conditionals_reordering.patch | 5.11 KB | fenstrat |
#5 | interdiff.txt | 645 bytes | fenstrat |
#2 | 1627656-2-conditionals_reordering.patch | 5.13 KB | fenstrat |
Comments
Comment #1
quicksketchI've noticed this problem too. Thanks for opening an official issue.
Comment #2
fenstratAttached patch fixes reordering not working.
Comment #3
quicksketchThanks @fenstrat! The code went through a few iterations where order was not relevant which is how we ended up in this situation. I'll review the patch when I get a chance.
Comment #4
fenstratNo worries @quicksketch, look forward to the review.
Comment #5
fenstratUpdate to #2 which used the incorrect $rgid.
I've also noticed form validation "illegal choice detected" errors when there's more than 20 conditions (i.e. more than the default $delta of 10) when deleting many conditions at one time. Unsure of the best way to get around that, but the rest is working well.
Comment #6
quicksketchThat's probably caused by the number of elements influencing the available values in the weight field. If there were once 15 conditionals and one of the conditionals had a weight defined of "-12", the -12 option wouldn't exist any more if you removed 5 conditionals. So Drupal throws an error because the default value was set to something that doesn't exist.
I modified your patch slightly to keep track of the "max" number of conditionals that have been used and always uses that $delta for the weight field. Seems to pass all my testing but another look would be appreciated. In the mean time I've committed this to the 4.x branch. Thanks!
Comment #7
fenstratYep, you're spot on with your reasoning for the "illegal choice detected" @quicksketch. Nice work around. Tested, works well.