From 0248aa237b06e51578c6c4a3c18e019b1b058707 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Thu, 6 Feb 2025 17:27:28 +0100 Subject: [PATCH] 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 --- Koha/AdditionalContents.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm index f434fba1a0e..73aca863081 100644 --- a/Koha/AdditionalContents.pm +++ b/Koha/AdditionalContents.pm @@ -91,7 +91,7 @@ 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 => 'additional_content.published_on' }; return Koha::AdditionalContentsLocalizations->search( $search_params, $attribs ); } -- 2.30.2