Bugzilla – Attachment 12092 Details for
Bug 8523
Authority hierarchies only support UNIMARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8523 follow-up: correctly handle leaves
Bug-8523-follow-up-correctly-handle-leaves.patch (text/plain), 1.76 KB, created by
Jared Camins-Esakov
on 2012-09-09 22:10:55 UTC
(
hide
)
Description:
Bug 8523 follow-up: correctly handle leaves
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-09-09 22:10:55 UTC
Size:
1.76 KB
patch
obsolete
>From 2731d38c8784d1c9b8cec391fcb94f9a524eb3d2 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Sun, 9 Sep 2012 18:24:36 -0400 >Subject: [PATCH] Bug 8523 follow-up: correctly handle leaves >Content-Type: text/plain; charset="UTF-8" > >--- > C4/AuthoritiesMarc.pm | 15 +++++++++++++-- > 1 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 64863ea..1c5a439 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1248,7 +1248,7 @@ sub BuildAuthHierarchy{ > $cell{"children"}=\@loopchildren; > $cell{"class"}=$class; > $cell{"authid"}=$authid; >- $cell{"current_value"} =1 if $authid eq $authid_constructed; >+ $cell{"current_value"} =1 if ($authid eq $authid_constructed); > $cell{"value"}=C4::Context->preference('marcflavour') eq 'UNIMARC' ? $record->subfield('2..',"a") : $record->subfield('1..', 'a'); > return \%cell; > } >@@ -1275,7 +1275,18 @@ sub BuildAuthHierarchyBranch { > if (scalar @$tree > 0) { > my $nextBranch = BuildAuthHierarchyBranch($tree, $authid, ++$cnt); > my $nextAuthid = $nextBranch->{authid}; >- push @{$branch->{children}}, $nextBranch unless grep {$_->{authid} == $nextAuthid} @{$branch->{children}}; >+ my $found; >+ # If we already have the next branch listed as a child, let's >+ # replace the old listing with the new one. If not, we will add >+ # the branch at the end. >+ foreach my $cell (@{$branch->{children}}) { >+ if ($cell->{authid} eq $nextAuthid) { >+ $cell = $nextBranch; >+ $found = 1; >+ last; >+ } >+ } >+ push @{$branch->{children}}, $nextBranch unless $found; > } > return $branch; > } >-- >1.7.2.5
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 8523
:
11360
|
11885
|
12083
|
12084
|
12086
|
12089
|
12092
|
12097
|
12100
|
12101
|
12125
|
12565