Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Sep 2014 at 20:16 UTC
Updated:
27 Jan 2017 at 17:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
swentel commentedComment #3
swentel commentedComment #4
swentel commentedhardcoded tests--
Comment #6
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 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 commentedComment #16
20th commentedAgain, now without typos.