From 0b4d68f0601a494c00b19d14c5af970ff04a0122 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 23 Jul 2014 12:43:54 -0400 Subject: [PATCH] Bug 12629 - Software error when trying to merge records from different frameworks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Test Plan: 1) Choose a bib record that has the default framework. 2) Add a second record using that fast add framework. 3) Merge the records; switch to "Using framework: Default", and choose the original record (i.e. the one that had the default framework) as the merge reference. Clicking 'Next' will trigger the error. 4) Apply this patch 5) Repeat steps 1 - 3, no error should occur Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit e8fcc651a3aa9af9d1a49a6cec64fc9bde737a86) Signed-off-by: Frédéric Demians --- Koha/Util/MARC.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Koha/Util/MARC.pm b/Koha/Util/MARC.pm index 22774b63b2..63477ea4e3 100644 --- a/Koha/Util/MARC.pm +++ b/Koha/Util/MARC.pm @@ -43,8 +43,11 @@ sub createMergeHash { foreach my $field (@fields) { my $fieldtag = $field->tag(); if ( $fieldtag < 10 ) { - if ( !defined($tagslib) - || $tagslib->{$fieldtag}->{'@'}->{'tab'} >= 0 ) + if ( + !defined($tagslib) + || ( defined( $tagslib->{$fieldtag} ) + && $tagslib->{$fieldtag}->{'@'}->{'tab'} >= 0 ) + ) { push @array, { tag => $fieldtag, -- 2.11.4.GIT