Bugzilla – Attachment 134663 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.76 KB, created by
David Nind
on 2022-05-05 20:47:05 UTC
(
hide
)
Description:
Bug 29719: Do not clear onloan value when not passed in MARC
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-05-05 20:47:05 UTC
Size:
1.76 KB
patch
obsolete
>From 1528a6843cf998bdfccef0c8b32af68a4d0a258c 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> >--- > C4/Items.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 65bf8bc971..a5b0a2f29d 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.30.2
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