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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

Status: Active » Needs review
FileSize
876 bytes

Status: Needs review » Needs work

The last submitted patch, 1: 2337653-1.patch, failed testing.

swentel’s picture

Issue summary: View changes
swentel’s picture

Status: Needs work » Needs review
FileSize
1.02 KB
838 bytes

hardcoded tests--

Status: Needs review » Needs work

The last submitted patch, 4: 2337653-3.patch, failed testing.

swentel’s picture

Status: Needs work » Needs review
FileSize
1.01 KB
641 bytes

Better patch

mgifford’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
71.47 KB

Looked over the code. Applied it to SimplyTest.me. Added 20+ languages and verified that it works as described.

webchick’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed and pushed to 8.x. Thanks!

  • webchick committed f618395 on 8.0.x
    Issue #2337653 by swentel: Fixed DraggableListBuilder should dynamically...

  • webchick committed f618395 on 8.1.x
    Issue #2337653 by swentel: Fixed DraggableListBuilder should dynamically...

  • webchick committed f618395 on 8.3.x
    Issue #2337653 by swentel: Fixed DraggableListBuilder should dynamically...

  • webchick committed f618395 on 8.3.x
    Issue #2337653 by swentel: Fixed DraggableListBuilder should dynamically...
20th’s picture

I 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:

filter_admin_overview()
filter_admin_format_form()
image_style_form()
locale_languages_overview_form()
locale_languages_configure_form()
profile_admin_overview()
shortcut_set_customize()
taxonomy_overview_vocabularies()
20th’s picture

Component: entity system » forms system
Status: Patch (to be ported) » Needs review

Status: Needs review » Needs work

The last submitted patch, 13: 2337653-13.patch, failed testing.

20th’s picture

Status: Needs work » Needs review
FileSize
7.29 KB

Again, now without typos.

  • webchick committed f618395 on 8.4.x
    Issue #2337653 by swentel: Fixed DraggableListBuilder should dynamically...

  • webchick committed f618395 on 8.4.x
    Issue #2337653 by swentel: Fixed DraggableListBuilder should dynamically...