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.
The patch definitely worked for me.
Tested on Drupal 8.7.x and 8.8.x.
RTBC! Thanks!
Comment | File | Size | Author |
---|---|---|---|
#31 | order_with_patch.png | 9.77 KB | colin.eininger |
#31 | order_without_patch.png | 9.76 KB | colin.eininger |
#9 | 2396923-table_sort.patch | 1.19 KB | Andrej Galuf |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedCould you add steps to reproduce?
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedJust use table form element type and set different weight for the rows. They will be displayed in the way they were added into the form instead of sorted by the weight value.
Comment #7
StryKaizerI can confirm that this is still an issue in 8.2.
Comment #9
Andrej Galuf CreditAttribution: Andrej Galuf commentedI just got hit by this issue myself when trying to implement a quick tablesort.As this effectively breaks tablesort in Form API, here's a quick reroll of the patch in OP against latest code.
Comment #10
Andrej Galuf CreditAttribution: Andrej Galuf commentedComment #13
stmh CreditAttribution: stmh at Factorial GmbH for Mediagroup KLAMBT commentedPatch works as expected on my end.
Comment #14
stmh CreditAttribution: stmh at Factorial GmbH commentedComment #16
rliThe path in #9 worked for me.
Comment #17
jonnyeom CreditAttribution: jonnyeom as a volunteer commentedComment #18
AardWolf CreditAttribution: AardWolf at ADCI Solutions commentedI think that tables don't need to be sorted always.
My solution is don't touch #sorted property in the form builder,
so if it was set up then a table or any other element will be sorted.
If it wasn't set up then there will be old logic of sorting.
Comment #19
AardWolf CreditAttribution: AardWolf at ADCI Solutions commentedComment #22
Anas_maw CreditAttribution: Anas_maw as a volunteer commentedPatch in #9 works as expected.
Patch in #10 does not work, and I think table rows should always be sorted when we have a #weight variable.
Comment #25
dennis_meuwissen CreditAttribution: dennis_meuwissen commentedCan also confirm that patch #9 works, with Drupal 8.9.16.
Comment #26
AardWolf CreditAttribution: AardWolf at ADCI Solutions commentedComment #27
wesleyl CreditAttribution: wesleyl at CI&T commentedTested patch #9 on Drupal 9.1.11 and work as expected.
Comment #28
oriol_e9gTests are not passing, we cannot commit any patch without tests in green.
Comment #29
oriol_e9gAh! Patches in #18 are not valid. The patch to review is #9. Sorry for the noise.
Comment #30
alexpottThe patch in #9 needs to tests to show the bug and prove that it has fixed them. Also the issue summary could do with more detail.
Comment #31
colin.eininger CreditAttribution: colin.eininger commentedI'm facing this issue in Drupal 9.2.6, but just figured out that patch #9 introduced a new bug in the administration menus.
To reproduce:
Resulting in children being split between all main items (see attached screenshots).
Comment #33
JI_GravityworksSeeing the same issue as reported in #31 -- used the patch in #9 to fix an error with the Redirect Page By Role module, but it completely re-arranged all of our second- and third-level navigation. Using 9.3.9 currently.