Bugzilla – Attachment 140201 Details for
Bug 31364
Saving multi-select system preference don't save when all checks are removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31364: Check length of the multiple syspref array instead whether it is null
Bug-31364-Check-length-of-the-multiple-syspref-arr.patch (text/plain), 1.58 KB, created by
Joonas Kylmälä
on 2022-09-04 11:44:58 UTC
(
hide
)
Description:
Bug 31364: Check length of the multiple syspref array instead whether it is null
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2022-09-04 11:44:58 UTC
Size:
1.58 KB
patch
obsolete
>From 22451d7ce19c2de581d66810e8ea964c5f6eec34 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Sun, 4 Sep 2022 14:37:46 +0300 >Subject: [PATCH] Bug 31364: Check length of the multiple syspref array instead > whether it is null > >The multiple systempreferences are always defined as an empty array at >the minimum, so in order to determine whether we need to remove all >the selections from the systempreference we should check whether the >array is empty and not whether the array doesn't exist. > >To test: > 1) Set at least 1 value for OPACHoldsIfAvailableAtPickupExceptions > 2) Remove all the values for OPACHoldsIfAvailableAtPickupExceptions > and notice you get the message "Nothing to save" > 3) Apply patch and repeat, removing all the values should work now. >--- > koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >index fb63d4b397..f5da1d92c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >@@ -13,7 +13,7 @@ KOHA.Preferences = { > // If a multiple select has all its entries unselected > var unserialized = new Array(); > $(modified_prefs).each(function(){ >- if ( $(this).attr('multiple') && $(this).val() == null ) { >+ if ( $(this).attr('multiple') && $(this).val().length == 0 ) { > unserialized.push($(this)); > } > }); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31364
:
140064
|
140102
|
140201
|
140220
|
140269