From c0af4d18c2eecb7507423e5de6f000662e36d03e Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 6 Apr 2010 13:27:20 +0200 Subject: [PATCH] BuildUnimarcHierarchies : Fixing infinite loop When referenced authority in 5XX$3 would be the same as the current authid, the script would get into infinite loop --- C4/AuthoritiesMarc.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 95e0655db1..7d9a2b4092 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1060,6 +1060,7 @@ sub BuildUnimarcHierarchies{ foreach my $field ($record->field('5..')){ if ($field->subfield('5') && $field->subfield('5') eq 'g'){ my $subfauthid=_get_authid_subfield($field); + next if ($subfauthid eq $authid); my $parentrecord = GetAuthority($subfauthid); my $localresult=$hierarchies; my $trees; -- 2.39.5