Bugzilla – Attachment 134997 Details for
Bug 29719
onloan dates are cleared from items when importing and overlaying
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29719: Do not clear onloan value when not passed in MARC
Bug-29719-Do-not-clear-onloan-value-when-not-passe.patch (text/plain), 1.82 KB, created by
Martin Renvoize (ashimema)
on 2022-05-14 07:57:54 UTC
(
hide
)
Description:
Bug 29719: Do not clear onloan value when not passed in MARC
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-14 07:57:54 UTC
Size:
1.82 KB
patch
obsolete
>From d45c361c26dfdc05d9136475c472828990a0f9ea Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 14 Jan 2022 19:59:30 +0000 >Subject: [PATCH] Bug 29719: Do not clear onloan value when not passed in MARC > >We blank the field to prevent users from setting it during import, but this has the >affect of blanking it in the DB. >This patch replaces the onloan field when not passed in to 'ModItemFromMARC' to preserve >the value > >To test: > 1 - Check an item out to a paron > 2 - Export the item using Tools->Export data > 3 - Stage the record for import > 4 - Match on 999c and replace items > 5 - Import the batch > 6 - View the record and note item is checked out and Available > 7 - In the DB note the onloan value is now null > 8 - Check in the item > 9 - Apply patch >10 - Repeat 1-5 >11 - View the record and note item is checked out >12 - In the DB note the onloan value matches the due date > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Items.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/C4/Items.pm b/C4/Items.pm >index a2bb4011a4..9808fadd1f 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -303,6 +303,10 @@ sub ModItemFromMarc { > my $item_object = Koha::Items->find($itemnumber); > my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode, 'items' ); > >+ # When importing items we blank this column, we need to set it to the existing value >+ # to prevent it being blanked by set_or_blank >+ $item->{onloan} = $item_object->onloan if( $item_object->onloan && !defined $item->{onloan} ); >+ > my ( $perm_loc_tag, $perm_loc_subfield ) = C4::Biblio::GetMarcFromKohaField( "items.permanent_location" ); > my $has_permanent_location = defined $perm_loc_tag && defined $item_marc->subfield( $perm_loc_tag, $perm_loc_subfield ); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29719
:
128635
|
128636
|
129515
|
129516
|
134662
|
134663
|
134996
| 134997