Created attachment 164420 [details] [review] Bug 36521: Checkbox preferences should be allowed to be submitted empty Visit: http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=i18n_l10n Uncheck English on both 'language' and 'OPACLanguages'. Save. Notice "Nothing to save" shows. Apply patch. Repeat. Notice you can now save with all options empty. To my knowledge, these 2 language preferences are the only checkbox preferences of this kind (correct me if I'm wrong please). I need to add a new system preference for bug 35604 listing all installed ILL backends so the user may enable or disable each of the backends. I want that particular system preference to be disabled as a whole if all backends are unchecked, but I was unable to uncheck all before this patch. I understand that for languages checkboxes specifically not allowing everything to be empty may make sense (at least one language should be enabled, after all). But these languages checkbox preferences should be the exception, not the rule, for this behaviour.
Created attachment 164421 [details] [review] Bug 36521: Checkbox preferences should be allowed to be submitted empty Visit: http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=i18n_l10n Uncheck English on both 'language' and 'OPACLanguages'. Save. Notice "Nothing to save" shows. Apply patch. Repeat. Notice you can now save with all options empty. To my knowledge, these 2 language preferences are the only checkbox preferences of this kind (correct me if I'm wrong please). I need to add a new system preference for bug 35604 listing all installed ILL backends so the user may enable or disable each of the backends. I want that particular system preference to be disabled as a whole if all backends are unchecked, but I was unable to uncheck all before this patch. I understand that for languages checkboxes specifically not allowing everything to be empty may make sense (at least one language should be enabled, after all). But these languages checkbox preferences should be the exception, not the rule, for this behaviour.
(In reply to Pedro Amorim from comment #2) > To my knowledge, these 2 language preferences are the only checkbox > preferences of this kind (correct me > if I'm wrong please). There is this patch in the queue https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163699 But I don't think they will conflict.
Thanks Joubu, I was not aware of that. I think there certainly may be some overlap there with what I'm doing in bug 35604 in regards to multiple checkboxes being sortable, although I've had to create my own 'ill_backends' system preference type (because the options I need are dynamically loaded depending on what backends are installed, not from hardcoded option values coming from a *.pref file). I'll definitely look at bug 29948 in the near future, probably rebase my work on that and see what can be reused/improved.
Found a bug: http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=lang language and opaclanguage have "English" Deselect English for language, save OK Deselect English for opaclanguage, save => "Nothing to save" FAIL
Created attachment 164427 [details] [review] Bug 36521: Checkbox preferences should be allowed to be submitted empty Visit: http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=i18n_l10n Uncheck English on both 'language' and 'OPACLanguages'. Save. Notice "Nothing to save" shows. Apply patch. Repeat. Notice you can now save with all options empty. To my knowledge, these 2 language preferences are the only checkbox preferences of this kind (correct me if I'm wrong please). I need to add a new system preference for bug 35604 listing all installed ILL backends so the user may enable or disable each of the backends. I want that particular system preference to be disabled as a whole if all backends are unchecked, but I was unable to uncheck all before this patch. I understand that for languages checkboxes specifically not allowing everything to be empty may make sense (at least one language should be enabled, after all). But these languages checkbox preferences should be the exception, not the rule, for this behaviour. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Jonathan Druart from comment #5) > Found a bug: > http://localhost:8081/cgi-bin/koha/admin/preferences. > pl?tab=&op=search&searchfield=lang > > language and opaclanguage have "English" > Deselect English for language, save OK > Deselect English for opaclanguage, save => "Nothing to save" FAIL Cache was not cleared, sorry!
Trivial, bad bug, passing QA.
Pushed for 24.05! Well done everyone, thank you!
Does not apply easy on 23.11.x. Please provide patches if needed.
(In reply to Fridolin Somers from comment #10) > Does not apply easy on 23.11.x. > Please provide patches if needed. Don't think it's needed. This is just a fix for a problem highlighted in bug 35604 where there is a need of being able to submit a checkbox preference as empty. Prior to bug 35604 (not yet pushed) the only checkbox preference(s) that exist is the language(s) preferences afaik and those work 'fine' not being able to submit empty. Happy to be corrected.