Bugzilla – Attachment 74565 Details for
Bug 19974
Marking an item as 'lost' will not actually modify the current item (cataloguing/additem.pl)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19974: (QA follow-up) Move lost logic to else branch
Bug-19974-QA-follow-up-Move-lost-logic-to-else-bra.patch (text/plain), 2.11 KB, created by
Séverine Queune
on 2018-04-19 14:28:26 UTC
(
hide
)
Description:
Bug 19974: (QA follow-up) Move lost logic to else branch
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-04-19 14:28:26 UTC
Size:
2.11 KB
patch
obsolete
>From 07d83ef641f36d36910e86b15f70db9c41a57e84 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 23 Mar 2018 09:34:46 +0100 >Subject: [PATCH] Bug 19974: (QA follow-up) Move lost logic to else branch > >If an error is raised for the barcode, we should not try to perform the >lost logic succeeding it. >Futhermore there is no need to go to GetMarcFromKohaField etc. if we just >use the output of ModItemFromMarc. > >Note: It seems unnecessary to clear $itemnumber, but I can understand >the anxiety about passing it to the template with op=additem. So just >leaving it here. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > cataloguing/additem.pl | 18 +++++++----------- > 1 file changed, 7 insertions(+), 11 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index bd394c3..802e908 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -687,20 +687,16 @@ if ($op eq "additem") { > # check that the barcode don't exist already > my $addedolditem = TransformMarcToKoha($itemtosave); > my $exist_itemnumber = get_item_from_barcode($addedolditem->{'barcode'}); >- my $item = GetItem( $itemnumber ); > if ($exist_itemnumber && $exist_itemnumber != $itemnumber) { > push @errors,"barcode_not_unique"; > } else { >- ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); >- $itemnumber=""; >- } >- my $olditemlost = $item->{'itemlost'}; >- >- my ($lost_tag,$lost_subfield) = GetMarcFromKohaField("items.itemlost",''); >- >- my $newitemlost = $itemtosave->subfield( $lost_tag, $lost_subfield ); >- if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){ >- LostItem( $item->{itemnumber} ); >+ my $item = GetItem( $itemnumber ); >+ my $newitem = ModItemFromMarc($itemtosave, $biblionumber, $itemnumber); >+ $itemnumber = q{}; >+ my $olditemlost = $item->{itemlost}; >+ my $newitemlost = $newitem->{itemlost}; >+ LostItem( $item->{itemnumber} ) >+ if $newitemlost && $newitemlost ge '1' && !$olditemlost; > } > $nextop="additem"; > } elsif ($op eq "delinkitem"){ >-- >2.1.4
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 19974
:
70525
|
73162
|
73163
|
73531
|
74106
|
74167
|
74238
|
74542
|
74564
|
74565
|
74566
|
74591
|
74594
|
74595
|
74596