Bug 15876

Summary: Removing a course-reserved item with no initial shelving location does not revert items.location to NULL
Product: Koha Reporter: Theodoros Theodoropoulos <theod>
Component: Course reservesAssignee: Baptiste <baptiste.wojtkowski>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: baptiste.wojtkowski, fridolin.somers, kyle
Version: 3.20   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10382
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13311
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Theodoros Theodoropoulos 2016-02-22 11:11:28 UTC
(This happens only when one changes the shelving location while the item is on a course_reserve)

Steps to replicate:

1) Find an item with NO shelving location info (ie one that has items.location=items.permanent_location=NULL in the DB and the OPAC/Intranet shows an empty string)
2) Add this item to a course reserve
3) Either when adding the item in the course reserve, or at a later stage CHANGE (from the course reserve screen!) the 'temporary' shelving location info that will be used by that course reserve, by selecting a value from the drop-down list. Let's say 'On Display'
4) Find the item in the OPAC or Intranet, the change is displayed (as expected)
5) REMOVE this specific item from the course reserve
6) Find the item again in the OPAC or Intranet. All the course-reserve related information is reverted back to the original values as expected, except the shelving location, which is NOT reverted back to 'empty'. The old value (in our example 'On Display') is still shown!.

FYI, NULL is added from items.location to course_items.location in step 2 as expected
However, that NULL value in NOT copied back to items.location or items.permanent_location in step 5 as expected, but instead the value from step 3 is retained.

(I have verified this behavior both with 3.20 and 3.22)
Comment 1 Baptiste 2017-06-15 13:16:45 UTC
This behaviour is common for all location changes:

In the code in C4/Items.pl  -> _do_column_fixes_for_mod, is is explicitely written that any change in item.location (except toward 'CART' and 'PROC'), if permanent_location is empty, it will be populated.

The question is now to know, is it pertinent to add an exception and not run this function for location in case of reserve course, but I don't think so.
Comment 2 Kyle M Hall 2018-02-01 19:19:54 UTC

*** This bug has been marked as a duplicate of bug 10382 ***