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.
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.
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.
Tested with Bug 30633 in Sandbox and additionally with ktd following the testplan
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>
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>
Thanks Jonathan, nice clean solution even if a little difficult to initially understand. Passing QA
Nice work everyone! Pushed to main for 25.11
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.
follow-up pushed to main