Bug 28986 - Parent itemtype not selected when editing circ rules
Summary: Parent itemtype not selected when editing circ rules
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-09 15:20 UTC by Nick Clemens
Modified: 2021-10-16 01:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11


Attachments
Bug 28986: Remove (All) notation to correctly select rule for editing (1.88 KB, patch)
2021-09-09 15:25 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28986: Remove (All) notation to correctly select rule for editing (1.94 KB, patch)
2021-09-09 16:59 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 28986: Remove (All) notation to correctly select rule for editing (2.08 KB, patch)
2021-09-11 15:07 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-09-09 15:20:58 UTC
To recreate:
1 - Go to Administration -> Item types
2 - Edit a type to have a parent of another type
3 - Go to Administration -> Circulation and fines rules
4 - Add a rule for the child type
5 - Add a rule for the parent type
6 - Click edit on child type, note dropdown in editor correctly selected
7 - Click edit on parent type - note dropdown menu refers to 'All' itemtypes
Comment 1 Nick Clemens 2021-09-09 15:25:12 UTC
Created attachment 124717 [details] [review]
Bug 28986: Remove (All) notation to correctly select rule for editing

This patch updates the JS comparison code to remove the '(All)' hint before comparing
to the current value

To test:
1 - Go to Administration -> Item types
2 - Edit a type to have a parent of another type
3 - Go to Administration -> Circulation and fines rules
4 - Add a rule for all categories for the child itemtype
5 - Add a rule for all categories for the parent itemtype
6 - Click edit on child type, note itemtype dropdown in editor correctly selected
7 - Click edit on parent type - note itemtype dropdown menu refers to 'All' itemtypes
8 - Apply patch
9 - Reload page and edit parent type rule
10 - Itemtype dropdown is correctly populated
Comment 2 Andrew Fuerste-Henry 2021-09-09 16:59:58 UTC
Created attachment 124718 [details] [review]
Bug 28986: Remove (All) notation to correctly select rule for editing

This patch updates the JS comparison code to remove the '(All)' hint before comparing
to the current value

To test:
1 - Go to Administration -> Item types
2 - Edit a type to have a parent of another type
3 - Go to Administration -> Circulation and fines rules
4 - Add a rule for all categories for the child itemtype
5 - Add a rule for all categories for the parent itemtype
6 - Click edit on child type, note itemtype dropdown in editor correctly selected
7 - Click edit on parent type - note itemtype dropdown menu refers to 'All' itemtypes
8 - Apply patch
9 - Reload page and edit parent type rule
10 - Itemtype dropdown is correctly populated

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Joonas Kylmälä 2021-09-11 15:07:48 UTC
Created attachment 124796 [details] [review]
Bug 28986: Remove (All) notation to correctly select rule for editing

This patch updates the JS comparison code to remove the '(All)' hint before comparing
to the current value

To test:
1 - Go to Administration -> Item types
2 - Edit a type to have a parent of another type
3 - Go to Administration -> Circulation and fines rules
4 - Add a rule for all categories for the child itemtype
5 - Add a rule for all categories for the parent itemtype
6 - Click edit on child type, note itemtype dropdown in editor correctly selected
7 - Click edit on parent type - note itemtype dropdown menu refers to 'All' itemtypes
8 - Apply patch
9 - Reload page and edit parent type rule
10 - Itemtype dropdown is correctly populated

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 4 Joonas Kylmälä 2021-09-11 15:12:24 UTC
Without refactoring the table logic here totally this looks like it is the best least-effort-fix we can do right now. I wonder at what state the new GUI for managing these circ rules is, the code here is very hacky and we cannot forever do this sort of one off fixes. Anyway passing QA since as I said, this is seemingly the best we can do right now without having the new editing page for circ rules or doing total refactoring.
Comment 5 Jonathan Druart 2021-09-20 12:48:21 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Kyle M Hall 2021-10-01 17:33:15 UTC
Pushed to 21.05.x for 21.05.05
Comment 7 Fridolin Somers 2021-10-06 20:10:32 UTC
Pushed to 20.11.x for 20.11.11
Comment 8 Victor Grousset/tuxayo 2021-10-16 01:32:06 UTC
Missing dependencies for 20.05.x, it shouldn't be affected, no backport.

Item type parent is only since 20.11.x