Bug 7634 - Permanent Location (shelving location) is NULL when Import MARC records tool is used
Summary: Permanent Location (shelving location) is NULL when Import MARC records tool ...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-01 16:29 UTC by Joy Nelson
Modified: 2016-06-21 21:38 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 7634: Make the tests pass (1.40 KB, patch)
2015-09-02 13:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7634: Add tests (2.63 KB, patch)
2015-09-02 13:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7634: Prevent permanent_location to be set to NULL if not defined (1.39 KB, patch)
2015-09-02 13:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7634: Make the tests pass (1.46 KB, patch)
2015-09-03 03:28 UTC, Chris Cormack
Details | Diff | Splinter Review
\# Attachment to Bug 7634 - Permanent Location (shelving location) is NULL when Import MARC records tool is used (2.69 KB, patch)
2015-09-03 03:28 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 7634: Prevent permanent_location to be set to NULL if not defined (1.44 KB, patch)
2015-09-03 03:28 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 7634: Make the tests pass (1.52 KB, patch)
2015-09-13 15:34 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 7634: Add tests (2.76 KB, patch)
2015-09-13 15:34 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 7634: Prevent permanent_location to be set to NULL if not defined (1.51 KB, patch)
2015-09-13 15:34 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joy Nelson 2012-03-01 16:29:45 UTC
When MARC records and items are ingested into Koha through the MARC record import tool, the items.permanent_location field is left NULL.  Items that are created through original cataloging have the items.permanent_location set to the items.location value.  

This causes serious issues when items are circulated and the library is using the CART/PROC system preferences.  NULL values in the permanent_location are then copied to the location field.
Comment 1 Owen Leonard 2014-07-11 12:18:36 UTC
Confirmed in master. I assume libraries are working around this by adding the correct value to items.permanent_location before/during import?
Comment 2 Joy Nelson 2015-07-21 14:28:58 UTC
Not sure.  I can say that if they are not (or do not know to add it or edit the item to force a permanent location value) then using the CART feature in Koha will cause data loss.  I continue to see this happen.


(In reply to Owen Leonard from comment #1)
> Confirmed in master. I assume libraries are working around this by adding
> the correct value to items.permanent_location before/during import?
Comment 3 Jonathan Druart 2015-09-02 13:47:54 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-09-02 13:47:57 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2015-09-02 13:48:07 UTC Comment hidden (obsolete)
Comment 6 Chris Cormack 2015-09-03 03:28:06 UTC Comment hidden (obsolete)
Comment 7 Chris Cormack 2015-09-03 03:28:22 UTC Comment hidden (obsolete)
Comment 8 Chris Cormack 2015-09-03 03:28:41 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2015-09-13 15:17:43 UTC
Question: should we provide an update database to fix the proble on existing databases? Something like:

If the location is not empty or CART or PROC, copy to permanent_location.
Comment 10 Katrin Fischer 2015-09-13 15:34:08 UTC
Created attachment 42495 [details] [review]
[PASSED QA] Bug 7634: Make the tests pass

This patch just fixed a master bug, if your database already has some
items.homebranch set to CPL

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2015-09-13 15:34:11 UTC
Created attachment 42496 [details] [review]
[PASSED QA] Bug 7634: Add tests

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2015-09-13 15:34:14 UTC
Created attachment 42497 [details] [review]
[PASSED QA] Bug 7634: Prevent permanent_location to be set to NULL if not defined

The permanent_location is correctly filled when an item is added from
the cataloguing module (routine set_item_default_location from
cataloguing/additem.pl).
But when records are imported, this filled is not managed. It's only on
editing (_do_column_fixes_for_mod called from ModItem).

This patch set the permanent_location item fields to the location value for all
items created, even the imported ones.

Test plan:
0/ Do not apply this patch
1/ Import a record with items using the "Stage MARC for import" tool
2/ Check the values for the permanent_location in the items table.
They are set to NULL
3/ Apply this patch
4/ Repeat 2 and confirm that now the permanent_location values are set
to the location values.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2015-09-13 15:37:09 UTC
I filed bug 14811 to deal with a related problem.
Comment 14 Tomás Cohen Arazi 2015-09-16 14:07:44 UTC
Patches pushed to master.

Thanks Jonathan!
Comment 15 Chris Cormack 2015-09-22 17:51:56 UTC
Pushed to 3.20.x will be in 3.20.4
Comment 16 Liz Rea 2015-09-23 00:42:07 UTC
pushed to 3.18.x will be in 3.18.11