From 04d137b06d1cc872941aab38ecc41e562c7a5554 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 2 Nov 2018 11:17:46 +0100 Subject: [PATCH] Bug 19349: (QA follow-up) Cosmetic changes [1] Construction with a // b instead of a; unless( a ) b; [2] Error checking on subfieldCode [3] Add explanation how to fill preference Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- C4/Biblio.pm | 6 ++---- Koha/Util/MARC.pm | 4 ++++ .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8e31dcd20b..808ed8d067 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -3325,10 +3325,8 @@ sub ModBiblioMarc { }; $record->as_usmarc; # Bug 20126/10455 This triggers field length calculation - my $m_rs = Koha::Biblio::Metadatas->find($metadata); - unless ($m_rs) { - $m_rs = Koha::Biblio::Metadata->new($metadata); - } + my $m_rs = Koha::Biblio::Metadatas->find($metadata) // + Koha::Biblio::Metadata->new($metadata); my $userenv = C4::Context->userenv; if ($userenv) { diff --git a/Koha/Util/MARC.pm b/Koha/Util/MARC.pm index a642b626ca..9268a166cb 100644 --- a/Koha/Util/MARC.pm +++ b/Koha/Util/MARC.pm @@ -211,6 +211,10 @@ sub set_marc_field { if ($marcField) { my ($fieldTag, $subfieldCode) = split /\$/, $marcField; + if( !$subfieldCode ) { + warn "set_marc_field: Invalid marcField format: $marcField\n"; + return; + } my $field = $record->field($fieldTag); if ($field) { $field->update($subfieldCode => $value); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index b25bf338d1..af80da855e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -144,11 +144,11 @@ Cataloging: - pref: MarcFieldForCreatorId - and record's creator name in MARC subfield - pref: MarcFieldForCreatorName - - - Store record's last modifier borrowernumber in MARC subfield - pref: MarcFieldForModifierId - and record's last modifier name in MARC subfield - pref: MarcFieldForModifierName + - "
NOTE: Use a dollar sign between field and subfield like 123$a." Display: - - 'Separate multiple displayed authors, series or subjects with ' -- 2.39.5