Bug 39027: Order news on opac-main.pl by publication date instead of ID
On the OPAC, news should rather be ordered by the publication date than by the creation date (~ id): a user want to see last published news first and not last created news, regardless of their publication date TEST PLAN: 1 - Create 3 news, have the 3 news published in an order different from their id (for example news 1 => 2020, news 2 => 2025, news 3 => 2023) 2 - Go on http://youropac/cgi-bin/koha/opac-main.pl -> news are ordered by ID APPLY PATCH 3 - Repeat 2 -> news are ordered by Date Signed-off-by: Mercury <mercury@coffee.geek.nz> Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
1bb30a26cd
commit
3af877e78a
|
|
@ -105,7 +105,10 @@ sub search_for_display {
|
|||
$search_params->{-or} = [ { 'lang' => $lang }, '-and' => [ 'lang', 'default', \$subquery ] ]
|
||||
if !$search_params->{lang};
|
||||
|
||||
my $attribs = { prefetch => 'additional_content', order_by => 'additional_content.number' };
|
||||
my $attribs = {
|
||||
prefetch => 'additional_content',
|
||||
order_by => { -desc => 'additional_content.published_on' }
|
||||
};
|
||||
return Koha::AdditionalContentsLocalizations->search( $search_params, $attribs );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue