Bug 27837: Check the MARC directly, not the transformed item
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 6 May 2021 12:09:04 +0000 (08:09 -0400)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 20 May 2021 12:50:15 +0000 (14:50 +0200)
commit4aaf0b3077ceae65b7da976f9cf47ad273051835
tree71b6cd3a170c1a8e3eb8aa654934dc4b4d3f51b4
parentbdbd2c7225f347ab23770b0b09f8f86816353ada
Bug 27837: Check the MARC directly, not the transformed item

If permanent location is mapped, it will exist in the MARC.
However, when we are transforming our item hash to MARC,
we are losing our permanent location mapping, at least in unit tests.

By checking the original MARC for the permenent location, we remove the
risk of losing it the "empty" permenent location through the
transformation process. We only need to know that it existed in the
original item marc to know we need to update it in the database.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit db382ebaffd393151e0ebd8e6579f5c11969a90c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Items.pm
t/db_dependent/Items.t