Bug 23083

Summary: Course reserve item edit fails if one does not set all values
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: Course reservesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, katrin.fischer, lucas, m.de.rooy, martin.renvoize
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22630
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22984
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03
Attachments: Bug 23083: Add tests
Bug 23083: Fix course reserve item editing if one of the value is set to UNCHANGED
Bug 23083: Add tests
Bug 23083: Fix course reserve item editing if one of the value is set to UNCHANGED
Bug 23083: Add tests
Bug 23083: Fix course reserve item editing if one of the value is set to UNCHANGED

Description Andrew Fuerste-Henry 2019-06-07 20:20:40 UTC
To Test:
1: Create an item with itype, ccode, location, and holding branch set
2: Create a course
3: Add item to course, changing the values for itype, ccode, and location
4: Click Edit for that item on course-details.pl
5: Assign new values for itype, ccode, and location but leave the holding library dropdown set to LEAVE UNCHANGED
6: Hit Save
7: Back on course-details.pl, observe that the item is still showing the values set in step 3
8: Edit the course reserve again, setting new values for itype, ccode, and location and setting the holding library dropdown to whatever the holding library for the item is currently
9: hit save
10: On course-details.pl, see that the change actually happened, the item is now showing the values set in step 9
Comment 1 Jonathan Druart 2019-06-08 18:21:15 UTC
I think the patch on bug 22630 (Do not modify item fields if course reserve item says LEAVE UNCHANGED) will fix this.
Comment 2 Andrew Fuerste-Henry 2019-06-10 12:23:06 UTC
Confirmed that applying the patch from 22630 fixes this. I'll mark this bug a dupe of that one. Thanks!
Comment 3 Andrew Fuerste-Henry 2019-06-10 12:23:22 UTC

*** This bug has been marked as a duplicate of bug 22630 ***
Comment 4 Jonathan Druart 2019-06-10 13:13:37 UTC
Instead I think the patch should be moved here, bug 22630 is an enhancement and will not be backported.
Comment 5 Katrin Fischer 2019-06-10 13:54:31 UTC
(In reply to Jonathan Druart from comment #4)
> Instead I think the patch should be moved here, bug 22630 is an enhancement
> and will not be backported.

I agree, not a real duplicate in this case, deduplicating, changing to a see also.
Comment 6 Katrin Fischer 2019-06-17 21:18:05 UTC
Updating severity
Comment 7 Jonathan Druart 2019-06-20 01:15:33 UTC
Created attachment 90818 [details] [review]
Bug 23083: Add tests
Comment 8 Jonathan Druart 2019-06-20 01:15:36 UTC
Created attachment 90819 [details] [review]
Bug 23083: Fix course reserve item editing if one of the value is set to UNCHANGED

Test plan:
0: Do not apply the patches
1: Create an item with itype, ccode, location, and holding branch set
2: Create a course
3: Add item to course, changing the values for itype, ccode, and location
4: Click Edit for that item on course-details.pl
5: Assign new values for itype, ccode, and location but leave the holding library dropdown set to LEAVE UNCHANGED
6: Hit Save
7: Back on course-details.pl, observe that the item is still showing the values set in step 3
8: Apply this patch
9: Repeat 4 to 6
10: Back on course-details.pl, observe that the item is now showing the correct values
11: Edit the course reserve again, setting new values for itype, ccode, and location and setting the holding library dropdown to whatever the holding library for the item is currently
12: hit save
13: On course-details.pl, see that the change actually happened, the item is now showing the values set in step 9
Comment 9 Martin Renvoize 2019-07-01 09:03:28 UTC
Created attachment 91134 [details] [review]
Bug 23083: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2019-07-01 09:03:31 UTC
Created attachment 91135 [details] [review]
Bug 23083: Fix course reserve item editing if one of the value is set to UNCHANGED

Test plan:
0: Do not apply the patches
1: Create an item with itype, ccode, location, and holding branch set
2: Create a course
3: Add item to course, changing the values for itype, ccode, and location
4: Click Edit for that item on course-details.pl
5: Assign new values for itype, ccode, and location but leave the holding library dropdown set to LEAVE UNCHANGED
6: Hit Save
7: Back on course-details.pl, observe that the item is still showing the values set in step 3
8: Apply this patch
9: Repeat 4 to 6
10: Back on course-details.pl, observe that the item is now showing the correct values
11: Edit the course reserve again, setting new values for itype, ccode, and location and setting the holding library dropdown to whatever the holding library for the item is currently
12: hit save
13: On course-details.pl, see that the change actually happened, the item is now showing the values set in step 9

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2019-07-01 09:03:51 UTC
Fix works for me in testing, Signing Off
Comment 12 Marcel de Rooy 2019-07-05 05:45:23 UTC
Created attachment 91309 [details] [review]
Bug 23083: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Marcel de Rooy 2019-07-05 05:45:28 UTC
Created attachment 91310 [details] [review]
Bug 23083: Fix course reserve item editing if one of the value is set to UNCHANGED

Test plan:
0: Do not apply the patches
1: Create an item with itype, ccode, location, and holding branch set
2: Create a course
3: Add item to course, changing the values for itype, ccode, and location
4: Click Edit for that item on course-details.pl
5: Assign new values for itype, ccode, and location but leave the holding library dropdown set to LEAVE UNCHANGED
6: Hit Save
7: Back on course-details.pl, observe that the item is still showing the values set in step 3
8: Apply this patch
9: Repeat 4 to 6
10: Back on course-details.pl, observe that the item is now showing the correct values
11: Edit the course reserve again, setting new values for itype, ccode, and location and setting the holding library dropdown to whatever the holding library for the item is currently
12: hit save
13: On course-details.pl, see that the change actually happened, the item is now showing the values set in step 9

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 14 Martin Renvoize 2019-07-05 07:45:39 UTC
Nice work!

Pushed to master for 19.11.00
Comment 15 Fridolin Somers 2019-07-25 13:39:59 UTC
Pushed to 19.05.x for 19.05.03
Comment 16 Lucas Gass 2019-07-26 15:49:21 UTC
backported to 18.11.x for 18.11.09