Bug 27654 - "Table settings for Pages" need to be sorted on "Administration -> Table settings"
Summary: "Table settings for Pages" need to be sorted on "Administration -> Table sett...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Peter Vashchuk
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-08 14:03 UTC by Peter Vashchuk
Modified: 2021-02-23 16:39 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.03,20.05.09


Attachments
Bug 27654: Sort module.keys hash when render columns_settings.tt (2.40 KB, patch)
2021-02-08 14:05 UTC, Peter Vashchuk
Details | Diff | Splinter Review
Bug 27654: Sort module.keys hash when render columns_settings.tt (2.46 KB, patch)
2021-02-08 23:50 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 27654: Sort module.keys hash when render columns_settings.tt (2.61 KB, patch)
2021-02-09 12:05 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Vashchuk 2021-02-08 14:03:32 UTC

    
Comment 1 Peter Vashchuk 2021-02-08 14:05:15 UTC
Created attachment 116500 [details] [review]
Bug 27654: Sort module.keys hash when render columns_settings.tt

On the "Administration -> Table settings" page, the order of
"tables related to pages" sections is different with each page refresh.
Cause of that is that Perl gives random order for hash keys where
those elements are stored on template render. To avoid that we
add a "sort" method where getting keys similarly how it was done
previously to display tables always in the same order.

To reproduce:
    1) Head over to /cgi-bin/koha/admin/columns_settings.pl
    2) Open any collapsed module settings, for example
"Acquisition tables". Check the order of pages.
    3) Reload the page. Check the order of the same elements again.
They always come in random order, it's easily distinguishable.
    4) Apply the patch.
    5) Repeat steps 1-3 again and ensure that the order of pages
stays the same no matter how many times you reload the page.
Comment 2 PTFS Europe Sandboxes 2021-02-08 23:50:53 UTC
Created attachment 116532 [details] [review]
Bug 27654: Sort module.keys hash when render columns_settings.tt

On the "Administration -> Table settings" page, the order of
"tables related to pages" sections is different with each page refresh.
Cause of that is that Perl gives random order for hash keys where
those elements are stored on template render. To avoid that we
add a "sort" method where getting keys similarly how it was done
previously to display tables always in the same order.

To reproduce:
    1) Head over to /cgi-bin/koha/admin/columns_settings.pl
    2) Open any collapsed module settings, for example
"Acquisition tables". Check the order of pages.
    3) Reload the page. Check the order of the same elements again.
They always come in random order, it's easily distinguishable.
    4) Apply the patch.
    5) Repeat steps 1-3 again and ensure that the order of pages
stays the same no matter how many times you reload the page.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 3 Joonas Kylmälä 2021-02-09 12:05:18 UTC
Created attachment 116574 [details] [review]
Bug 27654: Sort module.keys hash when render columns_settings.tt

On the "Administration -> Table settings" page, the order of
"tables related to pages" sections is different with each page refresh.
Cause of that is that Perl gives random order for hash keys where
those elements are stored on template render. To avoid that we
add a "sort" method where getting keys similarly how it was done
previously to display tables always in the same order.

To reproduce:
    1) Head over to /cgi-bin/koha/admin/columns_settings.pl
    2) Open any collapsed module settings, for example
"Acquisition tables". Check the order of pages.
    3) Reload the page. Check the order of the same elements again.
They always come in random order, it's easily distinguishable.
    4) Apply the patch.
    5) Repeat steps 1-3 again and ensure that the order of pages
stays the same no matter how many times you reload the page.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 4 Jonathan Druart 2021-02-12 11:18:58 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 5 Fridolin Somers 2021-02-19 14:51:34 UTC
Pushed to 20.11.x for 20.11.03
Comment 6 Andrew Fuerste-Henry 2021-02-22 22:55:28 UTC
Pushed to 20.05.x for 20.05.09
Comment 7 Victor Grousset/tuxayo 2021-02-23 16:39:00 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.