https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43215

            Bug ID: 43215
           Summary: Checkbox/sortable system preferences show one 'Saved
                    preference' message per option instead of per
                    preference
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: System Administration
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]
        Depends on: 42553
  Target Milestone: ---

Found while testing bug 42553 (multiple_sortable: authval dispatcher for
admin/preferences.pl).

When a system preference uses the multiple_sortable (checkbox-group) widget in
admin/preferences.pl - e.g. OPACAuthorIdentifiersAndInformation,
ArticleRequestsSupportedFormats, or a new authval-sourced pref such as the one
added by bug 42553 - saving the preference from Administration > System
preferences pops up one "Saved preference ..." confirmation line per
checkbox/option, instead of a single line for the preference itself.

For example, saving a pref called TestSortableAV with two selected authorised
values produces:

Saved preference TestSortableAV_CASH
Saved preference TestSortableAV_SIP00

Root cause: in koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js, the
".preference-checkbox" change handler marks every checkbox of every
checkbox-group preference on the page as "modified" (not just the ones
belonging to the changed preference), and dragging an item in the SortableJS
list synthetically fires change() on the list's first checkbox, triggering the
same global marking. KOHA.Preferences.Success() then builds the confirmation
message by iterating every ".modified" element and using its own DOM id (which
is per-checkbox, e.g. pref_TestSortableAV_CASH), rather than grouping by the
underlying preference name.

This is pre-existing behaviour, reproducible today on main with the existing
checkbox-group prefs. It is not introduced by bug 42553, but that patch makes
the widget easier to reach for new prefs, which is how it was noticed during
QA.

Test plan:
1. On a system with a multiple_sortable/checkbox-group syspref (e.g.
OPACAuthorIdentifiersAndInformation), select two or more checkboxes and save.
2. Note the confirmation message contains one "Saved preference ..." line per
checkbox rather than one line for the preference.
3. Expected: a single confirmation line per changed preference, regardless of
how many checkboxes/options it contains.


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42553
[Bug 42553] preferences.pl: Allow 'multiple_sortable' to use 'authval' source
for dynamic choices
-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to