Bug 36527 - Patron category or item type not changing when editing another circulation rule
Summary: Patron category or item type not changing when editing another circulation rule
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Phan Tung Bui
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-04 16:50 UTC by Caroline Cyr La Rose
Modified: 2024-09-17 03:25 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes editing circulation rules, where the patron category and item type didn't change when you were editing one rule and then changed to editing another rule. This could happen if you were: 1. Editing a rule. 2. Clicked on Edit to change another rule. 3. Confirmed that you wanted to edit another rule. Depending on your rules, the values for the patron category or item type in the editing row may not have changed.
Version(s) released in:
24.11.00,24.05.02,23.11.07
Circulation function:


Attachments
Bug 36527: Patron category or item type not changing when editing another circulation rule (3.07 KB, patch)
2024-04-11 20:11 UTC, Phan Tung Bui
Details | Diff | Splinter Review
Bug 36527: Patron category or item type not changing when editing another circulation rule (3.04 KB, patch)
2024-04-11 20:33 UTC, Phan Tung Bui
Details | Diff | Splinter Review
Bug 36527: Patron category or item type not changing when editing another circulation rule (3.11 KB, patch)
2024-04-12 15:33 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36527: Patron category or item type not changing when editing another circulation rule (3.16 KB, patch)
2024-06-26 13:30 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2024-04-04 16:50:11 UTC
This was reported to me as a slightly different problem, but I was able to recreate it partially in master.

When editing circulation rules, if you click on "Edit" on another rule and confirm you want to change that rule, the patron category and item type don't always change to the new one. 

To recreate: 
1. Go to Administration > Circulation and fine rules
2. Add a couple of rules with various patron category/item type combinations
3. Click on "Edit" next to one of the rules
   --> The line should become highlighted in yellow and the values should be copied in the very last row
4. Click on "Edit" next to another rule
5. Click OK in the browser dialog box to confirm you want to edit another rule
   --> Depending on the rules, the values for the patron category and/or item type might not change in the editing row
6. Repeat steps 4 and 5
   --> The patron category and item type do not always change


I'm using Chrome with 23.12.00.015 on KTD (it does the same on my local master and my local 23.05.05 too).

The person who reported it to me has 23.05.01. And their problem is that even on the first click (step 3), the values in the edit row are not the correct ones. The patron category stays "All" (the default value in the edit row), and the item type changes to the correct item type.

I thought it could be a cache problem, but with KTD I assumed that was all included and taken care of. We also restarted plack and memcache on the client's install and the problem remains.
Comment 1 Phan Tung Bui 2024-04-11 20:11:23 UTC Comment hidden (obsolete)
Comment 2 Phan Tung Bui 2024-04-11 20:33:42 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2024-04-12 15:33:16 UTC
Created attachment 164855 [details] [review]
Bug 36527: Patron category or item type not changing when editing another circulation rule

Plan test :
1. Go to Administration > Circulation and fine rules
2. Add a couple of rules with various patron category/item type
   combinations
3. Click on "Edit" next to one of the rules
   --> The line should become highlighted in yellow and the values
       should be copied in the very last row
4. Click on "Edit" next to another rule
5. Click OK in the browser dialog box to confirm you want to edit
   another rule
   --> Depending on the rules, the values for the patron category
       and/or item type might not change in the editing row
6. Repeat steps 4 and 5
   --> The patron category and item type do not always change
7. Apply the batch
8. Redo step from 3 to 6
9. Observe that category and item type change accordingly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Lucas Gass (lukeg) 2024-06-26 13:30:19 UTC
Created attachment 168144 [details] [review]
Bug 36527: Patron category or item type not changing when editing another circulation rule

Plan test :
1. Go to Administration > Circulation and fine rules
2. Add a couple of rules with various patron category/item type
   combinations
3. Click on "Edit" next to one of the rules
   --> The line should become highlighted in yellow and the values
       should be copied in the very last row
4. Click on "Edit" next to another rule
5. Click OK in the browser dialog box to confirm you want to edit
   another rule
   --> Depending on the rules, the values for the patron category
       and/or item type might not change in the editing row
6. Repeat steps 4 and 5
   --> The patron category and item type do not always change
7. Apply the batch
8. Redo step from 3 to 6
9. Observe that category and item type change accordingly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Katrin Fischer 2024-06-27 09:52:31 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 6 Lucas Gass (lukeg) 2024-07-18 21:31:31 UTC
Backported to 24.05.x for upcoming 24.05.02
Comment 7 Fridolin Somers 2024-07-19 09:47:33 UTC
Pushed to 23.11.x for 23.11.07
Comment 8 Wainui Witika-Park 2024-09-17 03:25:38 UTC
Not backporting to 23.05.x unless requested