Bug 34826 - Circulation rules edit row select elements don't always update when selecting new row for editing
Summary: Circulation rules edit row select elements don't always update when selecting...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-19 07:48 UTC by Mikko Liimatainen
Modified: 2024-04-05 07:00 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikko Liimatainen 2023-09-19 07:48:01 UTC
When editing circulation and fine rules selecting another row for editing without saving first can cause an issue where select elements on edit row don't update properly. This seems to be caused by adding additional selected values for select options each time different line is selected for editing.

For example if you select each item type rule for editing you can have all item types selected on edit row select element after which that element doesn't update at all anymore when selecting new row for editing.

I think clearing selected values from these select options each time when selecting new row for editing before adding selected value for the right option should fix the issue. At least there would no longer be conflict on which option value is actually selected.
Comment 1 Katrin Fischer 2023-09-19 07:53:27 UTC
I think it's not intended that you can add multiple rules without saving, you have to edit one after the other.
Comment 2 Katrin Fischer 2023-09-19 07:54:24 UTC
Can you maybe add a step by step? I don't fully understand the problem from your description I think.
Comment 3 Mikko Liimatainen 2023-09-19 08:59:51 UTC
It is not my intention to edit multiple rows. I just want to be able to switch edit rows without issues.

Step by step based on sandbox patron categories and itemtypes:
1. Create rules for all itemtypes and patron category all.
2. Create rules for all itemtypes and patron category patron.
3. Select rule for patron category  and itemtype books (patron_books) for editing.
4. Select rule all_music for editing. Notice that on the edit row patron category stays as patron.
5. Select rule all_maps for editing. Notice that on the edit row patron category stays as patron.
6. Select rule all_music for editing. Notice that on the edit row patron category stays as patron and item type stays as maps.
7. Select rule patron_books for editing. Notice that on the edit row patron category stays as patron and item type stays as maps.
8. Check edit row item type column select element options with browser inspect. Notice that multiple option values have selected attribute.
Comment 4 Emmi Takkinen 2024-04-03 07:30:49 UTC
I believe this is a same problem which was discovered in bug 34585. I wrote second patch "Bug 34585: Fix behaviour of select dropdowns when editing circulation rules" to fix this.
Comment 5 Mikko Liimatainen 2024-04-05 07:00:35 UTC
(In reply to Emmi Takkinen from comment #4)
> I believe this is a same problem which was discovered in bug 34585. I wrote
> second patch "Bug 34585: Fix behaviour of select dropdowns when editing
> circulation rules" to fix this.

Yes this is about those persisting selected attributes and that patch seems to correct the issue.