C4/XSLT contains this line: my $ref_status = C4::Context->preference('Reference_NFL_Statuses') || '1|2'; This is a kind of undocumented fallback (that I introduced myself). We should either add this to the pref text or just do what is kind of intuitively expected: if the pref is empty, move all items to Not available. Note that the installer creates the pref by default with 1|2. So this might be a quite theoretical change for most.
Created attachment 149921 [details] [review] Bug 33567: Empty NFL_statuses pref in unit test This test should fail now, since it would trigger the hardcoded fallback in the XSLT module. Test plan: Run t/db_dependent/XSLT.t Should fail. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 149922 [details] [review] Bug 33567: Remove hardcoded fallback in module Test plan: Run t/db_dependent/XSLT.t again Should pass now. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 149923 [details] [review] Bug 33567: Add a dbrev for installation with empty pref To keep current behavior, we can copy the removed fallback into the syspref value in case someone might have cleared the pref. Note: We are not restoring deleted prefs here; that is a data problem outside the scope of this report. A regular installation should always have this pref. Test plan: Run updatedatabase.pl Bonus: Clear the pref Reference_NFL_Statuses and run again, verify that the pref has changed. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Architectural/trivial: self SO
Created attachment 150837 [details] [review] Bug 33567: Empty NFL_statuses pref in unit test This test should fail now, since it would trigger the hardcoded fallback in the XSLT module. Test plan: Run t/db_dependent/XSLT.t Should fail. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 150838 [details] [review] Bug 33567: Remove hardcoded fallback in module Test plan: Run t/db_dependent/XSLT.t again Should pass now. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 150839 [details] [review] Bug 33567: Add a dbrev for installation with empty pref To keep current behavior, we can copy the removed fallback into the syspref value in case someone might have cleared the pref. Note: We are not restoring deleted prefs here; that is a data problem outside the scope of this report. A regular installation should always have this pref. Test plan: Run updatedatabase.pl Bonus: Clear the pref Reference_NFL_Statuses and run again, verify that the pref has changed. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Jonathan Druart from comment #7) > Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Thx.
Pushed to master for 23.05. Nice work everyone, thanks!
Enhancement - not backporting to 22.11.x