Bug 27654

Summary: "Table settings for Pages" need to be sorted on "Administration -> Table settings"
Product: Koha Reporter: Peter Vashchuk <stalkernoid>
Component: TemplatesAssignee: Peter Vashchuk <stalkernoid>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: trivial    
Priority: P5 - low CC: andrewfh, barbara.johnson, fridolin.somers, gmcharlt, joonas.kylmala, nugged, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
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
Bug 27654: Sort module.keys hash when render columns_settings.tt
Bug 27654: Sort module.keys hash when render columns_settings.tt

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.