Bugzilla – Attachment 160488 Details for
Bug 34585
"When to charge" columns value not copied when editing circulation rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34585: Fix behaviour of select dropdowns when editing circulation rules
Bug-34585-Fix-behaviour-of-select-dropdowns-when-e.patch (text/plain), 4.52 KB, created by
Lucas Gass (lukeg)
on 2024-01-03 16:32:06 UTC
(
hide
)
Description:
Bug 34585: Fix behaviour of select dropdowns when editing circulation rules
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-01-03 16:32:06 UTC
Size:
4.52 KB
patch
obsolete
>From 455ff3fc7c057630998ead0a0152e98adbd36b24 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Fri, 29 Dec 2023 13:48:39 +0200 >Subject: [PATCH] Bug 34585: Fix behaviour of select dropdowns when editing > circulation rules > >When chancing rule to edit via "Edit" button in circulation rules table, >dropdown values aren't always changed correctly. Pressing "Edit" first time >works, but after that previous rules values persist. Same happens when one >tries to clear edit row, values aren't set to default values. This happens >with every input with a dropdown in it. This mostly happanes because we set >attribute "selected" to selected options, but never clear them which leads >to values persisting. In columns "Patron category" and "Itemtype" value "All", >or "*" as it is in code, doesn't match to any existing values from database >and can't be changed via pressing "Edit" button. > >To reproduce: >1. Select a rule to edit and then select another rule to edit. >2. Repeat this couple of times and observe what values dropdowns fields display >in edit row. >=> Selected values in dropdowns aren't always changed based on rule that you are >currently editing. Instead after changing rule couple of times value doesn't change at all. >3. Press "Clear" button to return edit rows values back to default values. >=> Values in dropdowns aren't set back as default, instead they have same values as rule >you edited before pressing "Clear". > >After reproducing problem, apply this patch and proceed to test "Clear" and "Edit" buttons. > >To test "Edit" button: >1. Again, select a rule to edit and then select a another rule to edit. >2. Observe what values dropdowns fields display in edit row. >=> Confirm that values are changed based on rule that you are currently editing >and this behaviour doesn't change after selecting new rule to edit couple of times. > >To test "Clear" button: >1. Press "Clear" button. >=> Values in dropdowns should now be set as default values. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index cc4060dd90..4ca14cc91d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -218,7 +218,7 @@ > [% ELSE %] > 0 > [% END %]</td> >- <td data-code="[% c | html %]"> >+ <td data-code=[% IF i == undef %]"*"[% ELSE %]"[% c | html %]"[% END %]> > [% IF c == undef %] > <em>All</em> > [% ELSE %] >@@ -230,7 +230,7 @@ > [% ELSE %] > 0 > [% END %]</td> >- <td data-code="[% i | html %]"> >+ <td data-code=[% IF i == undef %]"*"[% ELSE %]"[% i | html %]"[% END %]> > [% IF i == undef %] > <em>All</em> > [% ELSE %] >@@ -1460,6 +1460,7 @@ > } > }); > $(edit_row).find("select").prop('disabled', false); >+ $(edit_row).find("select option:selected").removeAttr('selected'); > $(edit_row).find("select option:first-child").attr("selected", "selected"); > $(edit_row).find("td:last input[name='clear']").remove(); > } >@@ -1534,7 +1535,7 @@ > $(current_column).find("select option").each(function(){ > opt = $(this).attr('value'); > if ( opt == itm_code ) { >- $(this).attr('selected', 'selected'); >+ $(this).parent().val(opt); > } > }); > var current_input_id = $(current_column).children('input').first().attr('id'); >-- >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 34585
:
154688
|
160370
|
160488
|
170216
|
170234