Bugzilla – Attachment 126344 Details for
Bug 22204
Leading spaces in barcode should not allowed in cataloguing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22204: use barcodedecode from C4/Circulation in additem.pl
Bug-22204-use-barcodedecode-from-C4Circulation-in-.patch (text/plain), 1.64 KB, created by
Jérémy Breuillard
on 2021-10-15 14:41:45 UTC
(
hide
)
Description:
Bug 22204: use barcodedecode from C4/Circulation in additem.pl
Filename:
MIME Type:
Creator:
Jérémy Breuillard
Created:
2021-10-15 14:41:45 UTC
Size:
1.64 KB
patch
obsolete
>From f0b3b15858cdb141e06adc599c20cf6b2916d9a8 Mon Sep 17 00:00:00 2001 >From: jeremy breuillard <jeremy.breuillard@biblibre.com> >Date: Fri, 15 Oct 2021 14:37:12 +0000 >Subject: [PATCH] Bug 22204: use barcodedecode from C4/Circulation in > additem.pl > >--- > cataloguing/additem.pl | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index e309aac..29ad3c0 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -37,7 +37,7 @@ use C4::Biblio qw( > ); > use C4::Items qw( AddItemFromMarc ModItemFromMarc ); > use C4::Context; >-use C4::Circulation qw( LostItem ); >+use C4::Circulation qw( LostItem barcodedecode ); > use C4::Koha qw( GetAuthorisedValues ); > use C4::ClassSource qw( GetClassSources GetClassSource ); > use Koha::DateUtils qw( dt_from_string ); >@@ -84,15 +84,14 @@ sub get_item_from_barcode { > return($result); > } > >-sub _trim_barcode { >+sub _barcodedecode { > my ($record) = @_; > > my ($tagfield, $tagsubfield) = GetMarcFromKohaField('items.barcode'); > my $item_field = $record->field($tagfield); > my $barcode = $item_field->subfield($tagsubfield); > if ($barcode) { >- $barcode =~ s/^\s+//; >- $barcode =~ s/\s+$//; >+ $barcode = barcodedecode($barcode); > $item_field->update($tagsubfield => $barcode); > } > } >@@ -525,7 +524,7 @@ if ($op eq "additem") { > $add_duplicate_submit = 1 if ($prefillitem); > $justaddeditem = 1; > >- _trim_barcode($record); >+ _barcodedecode($record); > > # if autoBarcode is set to 'incremental', calculate barcode... > if ( C4::Context->preference('autoBarcode') eq 'incremental' ) { >-- >2.25.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 22204
:
126266
|
126344
|
126430