Bugzilla – Attachment 9410 Details for
Bug 7442
Crash when selecting an authority with 200$x or 200$y
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch #2
0001-Bug-7442-fix-for-selection-of-authorities-UNIMARC.patch (text/plain), 2.38 KB, created by
Adrien SAURAT
on 2012-05-04 08:57:40 UTC
(
hide
)
Description:
proposed patch #2
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-05-04 08:57:40 UTC
Size:
2.38 KB
patch
obsolete
>From 4ed8c0313cc85536f4eb738d8a6c627b82cdfdac Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Fri, 4 May 2012 10:53:59 +0200 >Subject: [PATCH] Bug 7442: fix for selection of authorities (UNIMARC) > >When editing a biblio record, if an authority >is searched the generated links now behave >correctly (if 200$x or 200$y exist they won't >have their own link). >Now encapsulated for UNIMARC. >--- > authorities/auth_finder.pl | 32 ++++++++++++++++++++++++++------ > 1 files changed, 26 insertions(+), 6 deletions(-) > >diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl >index a3821ee..4ad9022 100755 >--- a/authorities/auth_finder.pl >+++ b/authorities/auth_finder.pl >@@ -72,14 +72,34 @@ if ( $op eq "do_search" ) { > $resultsperpage, $authtypecode, $orderby); > > # If an authority heading is repeated, add an arrayref to those repetions >- # First heading -- Second heading > for my $heading ( @$results ) { >- my @repets = split / -- /, $heading->{summary}; >- if ( @repets > 1 ) { >- my @repets_loop; >- for (my $i = 0; $i < @repets; $i++) { >+ my @repets_loop; >+ if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) { >+ my $record = GetAuthority($heading->{'authid'}); >+ my $auth_name = ''; # will be displayed in the link tooltip >+ my $cpt = 0; >+ foreach my $field ($record->field('200')) { >+ $auth_name = $field->subfield('a'); >+ if ($field->subfield('b')) { $auth_name .= ', ' . $field->subfield('b') } >+ $cpt++; > push @repets_loop, >- { index => $index, repet => $i+1, value => $repets[$i] }; >+ { index => $index, repet => $cpt, value => $auth_name }; >+ } >+ if ( $cpt < 2 ) { >+ undef @repets_loop; >+ } >+ else { >+ $heading->{repets} = \@repets_loop; >+ } >+ } >+ else { >+ my @repets = split / -- /, $heading->{summary}; >+ if ( @repets > 1 ) { >+ my @repets_loop; >+ for (my $i = 0; $i < @repets; $i++) { >+ push @repets_loop, >+ { index => $index, repet => $i+1, value => $repets[$i] }; >+ } > } > $heading->{repets} = \@repets_loop; > } >-- >1.7.4.1 >
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 7442
:
7133
|
7135
|
9410
|
19776
|
19777
|
19778
|
19779
|
23152
|
23153