Bugzilla – Attachment 191823 Details for
Bug 39027
News are ordered with oldest on top
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39027: Order news on opac-main.pl by publication date instead of ID
Bug-39027-Order-news-on-opac-mainpl-by-publication.patch (text/plain), 1.54 KB, created by
mercury
on 2026-01-21 20:49:40 UTC
(
hide
)
Description:
Bug 39027: Order news on opac-main.pl by publication date instead of ID
Filename:
MIME Type:
Creator:
mercury
Created:
2026-01-21 20:49:40 UTC
Size:
1.54 KB
patch
obsolete
>From 78787057b9d9f67efd925a3d4b21dfc15f727fda Mon Sep 17 00:00:00 2001 >From: Baptiste <baptiste.wojtkowski@biblibre.com> >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 > >Signed-off-by: Mercury <mercury@coffee.geek.nz> >--- > Koha/AdditionalContents.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm >index 98a1b16..a30123d 100644 >--- a/Koha/AdditionalContents.pm >+++ b/Koha/AdditionalContents.pm >@@ -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 ); > } > >-- >2.39.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 39027
:
177588
|
190788
|
191251
| 191823