Bug 41042 - Table setting 'default sort order' not available for existing installations
Summary: Table setting 'default sort order' not available for existing installations
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks: 30633
  Show dependency treegraph
 
Reported: 2025-10-17 08:03 UTC by Jonathan Druart
Modified: 2025-10-23 17:34 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 41042: Simplify tests (16.82 KB, patch)
2025-10-17 08:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41042: Make 'default sort order' available to new installations (12.51 KB, patch)
2025-10-17 08:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41042: Simplify tests (16.94 KB, patch)
2025-10-20 12:06 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41042: Make 'default sort order' available to new installations (12.63 KB, patch)
2025-10-20 12:06 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41042: default_save_state is enabled by default (2.38 KB, patch)
2025-10-23 07:20 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-10-17 08:03:25 UTC
If a row exists in DB for a given table, default_sort_order will be NULL in DB which will replace the flag from the YAML file: the feature won't be available.
Comment 1 Jonathan Druart 2025-10-17 08:11:33 UTC
Created attachment 188048 [details] [review]
Bug 41042: Simplify tests

No change here.

Test plan:
Apply only this patch and confirm that the tests are still passing.
The previous code was dynamic but complicated to adjust. The next patch
needs more complex and specific comparisons.
Comment 2 Jonathan Druart 2025-10-17 08:11:35 UTC
Created attachment 188049 [details] [review]
Bug 41042: Make 'default sort order' available to new installations

If a row exists in DB for a given table, default_sort_order will be NULL
in DB which will replace the flag from the YAML file: the feature won't
be available.

Test plan:
0. checkout main (we don't want bug 30633)
1. Go to http://localhost:8081/cgi-bin/koha/admin/columns_settings.pl#biblio-detail%7Choldingst
=> Notice that "Default sort order" is not available for 'holdingst'
(it's added by bug 30633)
2. Save
3. Verify what you have in DB:
select * from tables_settings where module="opac" and tablename="holdingst";
4. Apply 30633, restart_all
5. Go to http://localhost:8081/cgi-bin/koha/admin/columns_settings.pl#biblio-detail%7Choldingst
=> Notice that "Default sort order" is not available for 'holdingst' (not ok)
6. Save
7. Verify what you have in DB:
select * from tables_settings where module="opac" and tablename="holdingst";
8. Apply this patch set
9. Go to http://localhost:8081/cgi-bin/koha/admin/columns_settings.pl#biblio-detail%7Choldingst
=> Notice that "Default sort order" is available for 'holdingst'!
10. Save, verify what you have in DB.
Comment 3 Michaela Sieber 2025-10-17 14:03:28 UTC
Tested with Bug 30633
in Sandbox and additionally with ktd following the testplan
Comment 4 Martin Renvoize (ashimema) 2025-10-20 12:06:25 UTC
Created attachment 188159 [details] [review]
Bug 41042: Simplify tests

No change here.

Test plan:
Apply only this patch and confirm that the tests are still passing.
The previous code was dynamic but complicated to adjust. The next patch
needs more complex and specific comparisons.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 5 Martin Renvoize (ashimema) 2025-10-20 12:06:27 UTC
Created attachment 188160 [details] [review]
Bug 41042: Make 'default sort order' available to new installations

If a row exists in DB for a given table, default_sort_order will be NULL
in DB which will replace the flag from the YAML file: the feature won't
be available.

Test plan:
0. checkout main (we don't want bug 30633)
1. Go to http://localhost:8081/cgi-bin/koha/admin/columns_settings.pl#biblio-detail%7Choldingst
=> Notice that "Default sort order" is not available for 'holdingst'
(it's added by bug 30633)
2. Save
3. Verify what you have in DB:
select * from tables_settings where module="opac" and tablename="holdingst";
4. Apply 30633, restart_all
5. Go to http://localhost:8081/cgi-bin/koha/admin/columns_settings.pl#biblio-detail%7Choldingst
=> Notice that "Default sort order" is not available for 'holdingst' (not ok)
6. Save
7. Verify what you have in DB:
select * from tables_settings where module="opac" and tablename="holdingst";
8. Apply this patch set
9. Go to http://localhost:8081/cgi-bin/koha/admin/columns_settings.pl#biblio-detail%7Choldingst
=> Notice that "Default sort order" is available for 'holdingst'!
10. Save, verify what you have in DB.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 6 Martin Renvoize (ashimema) 2025-10-20 12:07:42 UTC
Thanks Jonathan, nice clean solution even if a little difficult to initially understand.

Passing QA
Comment 7 Lucas Gass (lukeg) 2025-10-20 16:14:53 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 8 Jonathan Druart 2025-10-23 07:20:02 UTC
Created attachment 188304 [details] [review]
Bug 41042: default_save_state is enabled by default

If 'default_save_state' is not in the yaml file then the feature is
enabled by default.

Caught by the following failure:
t/db_dependent/selenium/patrons_search.t ..
        #   Failed test 'Search works when category of patrons is limited to a library we are not signed in at'
        #   at t/db_dependent/selenium/patrons_search.t line 471.
        #          got: 'Showing 1 to 5 of 26 entries (filtered from 82 total entries)'
        #     expected: 'Showing 1 to 15 of 26 entries (filtered from 82 total entries)'
        # Looks like you failed 1 test of 1.
Comment 9 Lucas Gass (lukeg) 2025-10-23 17:34:11 UTC
follow-up pushed to main