{
join => [ 'virtualshelfshares' ],
group_by => 'shelfnumber',
- order_by => 'lastmodified desc',
+ order_by => { -desc => 'lastmodified' },
}
);
}
$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;
prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ],
page => $page,
rows => $rows,
- order_by => "$order_by $direction",
+ order_by => { "-$direction" => $order_by },
}
);
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;
prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ],
page => $page,
rows => $rows,
- order_by => "$order_by $direction",
+ order_by => { "-$direction" => $order_by },
}
);