Bugzilla – Attachment 7135 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
0001-Bug-7442-Corrects-selection-of-authorities.patch (text/plain), 1.93 KB, created by
Adrien SAURAT
on 2012-01-13 13:46:34 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-01-13 13:46:34 UTC
Size:
1.93 KB
patch
obsolete
>From f956e51551bb4257dbd65563498ea06263a0ee7f Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Fri, 13 Jan 2012 14:42:25 +0100 >Subject: [PATCH] Bug 7442: Corrects selection of authorities > >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). >--- > authorities/auth_finder.pl | 25 ++++++++++++++++--------- > 1 files changed, 16 insertions(+), 9 deletions(-) > >diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl >index 99ac2c1..6a2b052 100755 >--- a/authorities/auth_finder.pl >+++ b/authorities/auth_finder.pl >@@ -72,16 +72,23 @@ 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++) { >- push @repets_loop, >- { index => $index, repet => $i+1, value => $repets[$i] }; >- } >- $heading->{repets} = \@repets_loop; >+ my $record = GetAuthority($heading->{'authid'}); >+ my $auth_name = ''; # will be displayed in the link tooltip >+ my $cpt = 0; >+ my @repets_loop; >+ 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 => $cpt, value => $auth_name }; >+ } >+ if ( $cpt < 2 ) { >+ undef @repets_loop; >+ } >+ else { >+ $heading->{repets} = \@repets_loop > } > } > # multi page display gestion >-- >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