Bug 15760: Fix order by direction for shelves
The order_by parameters should not be "$direction $order_by" with
quote_names enabled. The correct syntax is { -$direction => $order_by }
Test plan for Opac + Staff interfces:
Sort list by title or whatever and change the direction
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
parent
16e55c1f32
commit
71d4942c30
|
|
@ -114,7 +114,7 @@ sub get_some_shelves {
|
|||
{
|
||||
join => [ 'virtualshelfshares' ],
|
||||
group_by => 'shelfnumber',
|
||||
order_by => 'lastmodified desc',
|
||||
order_by => { -desc => 'lastmodified' },
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ if ( $op eq 'view' ) {
|
|||
$category = $shelf->category;
|
||||
my $sortfield = $query->param('sortfield') || $shelf->sortfield; # Passed in sorting overrides default sorting
|
||||
my $direction = $query->param('direction') || 'asc';
|
||||
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
|
||||
my ( $page, $rows );
|
||||
unless ( $query->param('print') or $query->param('rss') ) {
|
||||
$rows = C4::Context->preference('OPACnumSearchResults') || 20;
|
||||
|
|
@ -235,7 +236,7 @@ if ( $op eq 'view' ) {
|
|||
prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ],
|
||||
page => $page,
|
||||
rows => $rows,
|
||||
order_by => "$order_by $direction",
|
||||
order_by => { "-$direction" => $order_by },
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ if ( $op eq 'view' ) {
|
|||
if ( $shelf->can_be_viewed( $loggedinuser ) ) {
|
||||
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting
|
||||
my $direction = $query->param('direction') || 'asc';
|
||||
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
|
||||
my ( $rows, $page );
|
||||
unless ( $query->param('print') ) {
|
||||
$rows = C4::Context->preference('numSearchResults') || 20;
|
||||
|
|
@ -208,7 +209,7 @@ if ( $op eq 'view' ) {
|
|||
prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ],
|
||||
page => $page,
|
||||
rows => $rows,
|
||||
order_by => "$order_by $direction",
|
||||
order_by => { "-$direction" => $order_by },
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue