Bugzilla – Attachment 13442 Details for
Bug 9072
Add CheckValidity option to Linker
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-9072-Add-sort-order-option-to-Linker.patch (text/plain), 2.58 KB, created by
Fridolin Somers
on 2012-11-14 11:12:20 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2012-11-14 11:12:20 UTC
Size:
2.58 KB
patch
obsolete
>From aa230dee720a3e20e4da6db79b34da415177bf25 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Wed, 14 Nov 2012 12:10:44 +0100 >Subject: [PATCH] Bug 9072: Add sort order option to Linker > >--- > C4/Heading.pm | 11 +++++++---- > C4/Linker/Default.pm | 13 +++++++++++-- > 2 files changed, 18 insertions(+), 6 deletions(-) > >diff --git a/C4/Heading.pm b/C4/Heading.pm >index dca4d1b..4872a87 100644 >--- a/C4/Heading.pm >+++ b/C4/Heading.pm >@@ -151,7 +151,8 @@ SearchAuthorities will return only authids. > sub authorities { > my $self = shift; > my $skipmetadata = shift; >- my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata ); >+ my $sortorder = shift; >+ my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata, $sortorder ); > return $results; > } > >@@ -166,8 +167,9 @@ that are a preferred form of the heading. > > sub preferred_authorities { > my $self = shift; >- my $skipmetadata = shift || undef; >- my ( $results, $total ) = _search( 'see-from', $skipmetadata ); >+ my $skipmetadata = shift; >+ my $sortorder = shift; >+ my ( $results, $total ) = _search( 'see-from', $skipmetadata, $sortorder ); > return $results; > } > >@@ -181,6 +183,7 @@ sub _search { > my $self = shift; > my $index = shift || undef; > my $skipmetadata = shift || undef; >+ my $sortorder = shift || 'AuthidAsc'; > my @marclist; > my @and_or; > my @excluding = []; >@@ -205,7 +208,7 @@ sub _search { > return C4::AuthoritiesMarc::SearchAuthorities( > \@marclist, \@and_or, \@excluding, \@operator, > \@value, 0, 20, $self->{'auth_type'}, >- 'AuthidAsc', $skipmetadata >+ $sortorder, $skipmetadata > ); > } > >diff --git a/C4/Linker/Default.pm b/C4/Linker/Default.pm >index 445b408..bc1583d 100644 >--- a/C4/Linker/Default.pm >+++ b/C4/Linker/Default.pm >@@ -39,8 +39,17 @@ sub get_link { > } > else { > >- # look for matching authorities >- my $authorities = $heading->authorities(1); # $skipmetadata = true >+ # results sort order (defined in LinkerOptions) >+ my $sortorder; >+ foreach (qw( HeadingAsc HeadingDsc AuthidAsc AuthidDsc )) { >+ if ( $self->{$_} ) { >+ $sortorder = $_; >+ last; >+ } >+ } >+ >+ # look for matching authorities ($skipmetadata = true) >+ my $authorities = $heading->authorities( 1, $sortorder ); > > if ( $behavior eq 'default' && $#{$authorities} == 0 ) { > $authid = $authorities->[0]->{'authid'}; >-- >1.7.9.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 9072
:
13442
|
13481
|
13482
|
13483
|
13487
|
13488
|
13489
|
13490