Bugzilla – Attachment 72272 Details for
Bug 20304
Warnings in cataloguing scripts need to be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20304: Remove warnings from cataloguing scripts
Bug-20304-Remove-warnings-from-cataloguing-scripts.patch (text/plain), 4.24 KB, created by
Jonathan Druart
on 2018-02-27 16:37:19 UTC
(
hide
)
Description:
Bug 20304: Remove warnings from cataloguing scripts
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-02-27 16:37:19 UTC
Size:
4.24 KB
patch
obsolete
>From e3db63092275958f479a168acfaed3976b3e64e7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 27 Feb 2018 13:36:21 -0300 >Subject: [PATCH] Bug 20304: Remove warnings from cataloguing scripts > >--- > cataloguing/additem.pl | 39 +++++++++++++++++++++++---------------- > 1 file changed, 23 insertions(+), 16 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index a6aa25cd0e..228e16b0f8 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -128,20 +128,23 @@ sub generate_subfield_form { > $subfield_data{repeatable} = $subfieldlib->{repeatable}; > $subfield_data{maxlength} = $subfieldlib->{maxlength}; > >- $value =~ s/"/"/g; > if ( ! defined( $value ) || $value eq '') { > $value = $subfieldlib->{defaultvalue}; >- # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value >- my $today_dt = dt_from_string; >- my $year = $today_dt->strftime('%Y'); >- my $month = $today_dt->strftime('%m'); >- my $day = $today_dt->strftime('%d'); >- $value =~ s/<<YYYY>>/$year/g; >- $value =~ s/<<MM>>/$month/g; >- $value =~ s/<<DD>>/$day/g; >- # And <<USER>> with surname (?) >- my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); >- $value=~s/<<USER>>/$username/g; >+ if ( $value ) { >+ # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value >+ my $today_dt = dt_from_string; >+ my $year = $today_dt->strftime('%Y'); >+ my $month = $today_dt->strftime('%m'); >+ my $day = $today_dt->strftime('%d'); >+ $value =~ s/<<YYYY>>/$year/g; >+ $value =~ s/<<MM>>/$month/g; >+ $value =~ s/<<DD>>/$day/g; >+ # And <<USER>> with surname (?) >+ my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); >+ $value=~s/<<USER>>/$username/g; >+ } >+ } else { >+ $value =~ s/"/"/g; > } > > $subfield_data{visibility} = "display:none;" if (($subfieldlib->{hidden} > 4) || ($subfieldlib->{hidden} <= -4)); >@@ -153,7 +156,9 @@ sub generate_subfield_form { > my $CNsubfield2 = substr($pref_itemcallnumber, 4, 1); > my $temp2 = $temp->field($CNtag); > if ($temp2) { >- $value = ($temp2->subfield($CNsubfield)).' '.($temp2->subfield($CNsubfield2)); >+ my $value = q{}; >+ $value .= $temp2->subfield($CNsubfield) if $temp2->subfield($CNsubfield); >+ $value .= $temp2->subfield($CNsubfield2) if $temp2->subfield($CNsubfield2); > #remove any trailing space incase one subfield is used > $value =~ s/^\s+|\s+$//g; > } >@@ -293,7 +298,9 @@ sub generate_subfield_form { > }; > } > elsif ( >- length($value) > 100 >+ ( >+ $value and length($value) > 100 >+ ) > or ( > C4::Context->preference("marcflavour") eq "UNIMARC" > and 300 <= $tag && $tag < 400 && $subfieldtag eq 'a' >@@ -323,7 +330,7 @@ sub generate_subfield_form { > my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing'); > my $allowAllSubfields = ( > not defined $subfieldsToAllowForRestrictedEditing >- or $subfieldsToAllowForRestrictedEditing == q|| >+ or $subfieldsToAllowForRestrictedEditing ne q|| > ) ? 1 : 0; > my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing); > >@@ -370,7 +377,7 @@ my $input = new CGI; > my $error = $input->param('error'); > my $biblionumber = $input->param('biblionumber'); > my $itemnumber = $input->param('itemnumber'); >-my $op = $input->param('op'); >+my $op = $input->param('op') || q{}; > my $hostitemnumber = $input->param('hostitemnumber'); > my $marcflavour = C4::Context->preference("marcflavour"); > my $searchid = $input->param('searchid'); >-- >2.11.0
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 20304
:
72271
|
72272
|
73522
|
73869
|
73961
|
74876
|
74877