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.
True story, if you have more then 20 languages (in my case 45 and growing) you can't suddenly order the language overview page anymore (or at least in a meaningful way) because the delta is not big enough in the weight field.
Kind of silly to have to fix this here and then later on in D7 in a complete different file, but oh well.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2337653-15.patch | 7.29 KB | 20th |
#7 | Screen Shot 2014-09-23 at 10.44.16 AM.png | 71.47 KB | mgifford |
#6 | interdiff.txt | 641 bytes | swentel |
#6 | 2337653-6.patch | 1.01 KB | swentel |
#4 | interdiff.txt | 838 bytes | swentel |
Comments
Comment #1
swentel CreditAttribution: swentel commentedComment #3
swentel CreditAttribution: swentel commentedComment #4
swentel CreditAttribution: swentel commentedhardcoded tests--
Comment #6
swentel CreditAttribution: swentel commentedBetter patch
Comment #7
mgiffordLooked over the code. Applied it to SimplyTest.me. Added 20+ languages and verified that it works as described.
Comment #8
webchickCommitted and pushed to 8.x. Thanks!
Comment #13
20th CreditAttribution: 20th commentedI don't think it is possible to port this patch to D7 in a real sense.
Unlike D8, there is no central class or function that can be used to construct draggable lists. The order of records is changed by using the
'weight'
element.Even though each such
'weight'
element is processed with a callback, this callback would need an access to the whole form array to figure out the minimal delta value for each form, and this would be a big change in Form API.This is really a responsibility of the form constructor to count beforehand the number of ordered records in the form, and pass the appropriate value as the
'#delta'
parameter.The following patch will try to add
'#delta'
parameter to weights in all core forms if it is possible to figure out a delta value and if a form does not have it yet. At the very least, this patch solves the languages ordering problem described in the issue summary.The following forms are affected by the patch:
Comment #14
20th CreditAttribution: 20th commentedComment #16
20th CreditAttribution: 20th commentedAgain, now without typos.