Bug 22142

Summary: An item's current location changes to blank when it is removed from Course Reserves
Product: Koha Reporter: Kelly McElligott <kelly>
Component: Course reservesAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: blocker    
Priority: P5 - low CC: costalc, fridolin.somers, jonathan.druart, joy, jzairo, katrin.fischer, kyle, lucas, marjorie.barry-vila, martin.renvoize, nick, patrick.robitaille, severine.queune, wizzyrea
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03
Bug Depends on: 10382    
Bug Blocks:    
Attachments: Bug 22142: Highlight the issue
Bug 22142: Do not revert data if 'unchanged' was set
Bug 22142: Highlight the issue
Bug 22142: Do not revert data if 'unchanged' was set
Bug 22142: Highlight the issue
Bug 22142: Do not revert data if 'unchanged' was set

Description Kelly McElligott 2019-01-16 14:55:16 UTC
When removing items from a course reserve, Koha is removing the current location field unless the current location was modified when it was added to the course.

Steps:
1.Add an item to an existing active course reserve.
2. Modify Item Type, Shelving Location, Collection code
3.  Confirm these changes were made to the item,
4. Remove this item from an active course reserve.
5. See that the item type, shelving location and collection code was reverted to its original value, however, see that the Current Location is now empty.



Steps:
1.Add an item to an existing active course reserve.
2. Modify Item Type, Shelving Location, Collection code, and Holding Library
3.  Confirm these changes were made to the item,
4. Remove this item from an active course reserve.
5. See that the item type, shelving location and collection code was reverted to its original place, however, see that the Current Location correctly added back.


This is happening on 18.05.06, 18.05.07 and 18.11
Comment 1 Séverine Queune 2019-02-27 09:59:06 UTC
I've got a slightly different problem on 18.05.00 (and on the demo Koha of Biblibre 18.05.06.000 and 18.11.03.000) : on step 5, after removing an item of a course reserve, all fields modified in the course reserve are applied, and none of of the original values are kept.
Comment 2 Nick Clemens 2019-06-12 20:21:14 UTC
This is confirmed on master:

Add an item to a course (active or inactive) change no fields, remove it from the course, itemtype, location and collection are cleared

Add it again, this time changing all the fields, then remove it. Those fields are all set!
Comment 3 Nick Clemens 2019-06-13 14:20:43 UTC
Created attachment 90577 [details] [review]
Bug 22142: Highlight the issue
Comment 4 Katrin Fischer 2019-07-10 06:19:55 UTC
*** Bug 22984 has been marked as a duplicate of this bug. ***
Comment 5 Katrin Fischer 2019-07-10 06:21:35 UTC
We are losing data here... any chance for a fix?
Comment 6 Jonathan Druart 2019-08-05 15:55:32 UTC
Created attachment 92015 [details] [review]
Bug 22142: Do not revert data if 'unchanged' was set
Comment 7 Jonathan Druart 2019-08-05 15:56:07 UTC
Here is a quick try, tests are passing so it should fix the reported issues.
Comment 8 Kyle M Hall 2019-08-12 12:32:59 UTC
Created attachment 92152 [details] [review]
Bug 22142: Highlight the issue

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2019-08-12 12:33:52 UTC
Created attachment 92153 [details] [review]
Bug 22142: Do not revert data if 'unchanged' was set

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Katrin Fischer 2019-08-13 05:55:39 UTC
Created attachment 92168 [details] [review]
Bug 22142: Highlight the issue

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2019-08-13 05:55:43 UTC
Created attachment 92169 [details] [review]
Bug 22142: Do not revert data if 'unchanged' was set

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2019-08-13 05:56:15 UTC
Really glad to see this one resolved!
Comment 13 Martin Renvoize 2019-08-13 10:33:34 UTC
Nice work!

Pushed to master for 19.11.00
Comment 14 Liz Rea 2019-08-27 19:12:15 UTC
Any chance to backport this to 19.05/18.11?
Comment 15 Fridolin SOMERS 2019-08-28 13:27:18 UTC
Pushed to 19.05.x for 19.05.03
Comment 16 Lucas Gass 2019-08-28 15:26:09 UTC
backported to 18.11.x for 18.11.09