From e23c461311f83cfd358ec4b7ad5c53b7be26c817 Mon Sep 17 00:00:00 2001
From: Mark Tompsett <mtompset@hotmail.com>
Date: Wed, 19 Feb 2014 23:41:05 -0500
Subject: [PATCH] Bug 11797 - auth_finder.pl: Odd number of elements in
 anonymous hash

Added missing 162 MARC authorities tag and missing else case.
If the records are not in a given order the first substring of
the previous tag could be not 'a', but only 'a' exists for 162,
so the hash would have "hemain => " which triggers the error.
That's my theory anyways.
---
 C4/AuthoritiesMarc.pm |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm
index 1c87285..677f187 100644
--- a/C4/AuthoritiesMarc.pm
+++ b/C4/AuthoritiesMarc.pm
@@ -1024,6 +1024,8 @@ sub BuildSummary {
                 $subfields_to_report = 'avxyz';
             } elsif ($tag eq '155') {
                 $subfields_to_report = 'abvxyz';
+            } elsif ($tag eq '162') {
+                $subfields_to_report = 'a';
             } elsif ($tag eq '180') {
                 $subfields_to_report = 'vxyz';
             } elsif ($tag eq '181') {
@@ -1032,6 +1034,8 @@ sub BuildSummary {
                 $subfields_to_report = 'vxyz';
             } elsif ($tag eq '185') {
                 $subfields_to_report = 'vxyz';
+            } else {
+                $subfields_to_report = '';
             }
             if ($subfields_to_report) {
                 push @authorized, {
-- 
1.7.9.5