Bugzilla – Attachment 177588 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.47 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-02-06 16:32:27 UTC
(
hide
)
Description:
Bug 39027: Order news on opac-main.pl by publication date instead of ID
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-02-06 16:32:27 UTC
Size:
1.47 KB
patch
obsolete
>From 0248aa237b06e51578c6c4a3c18e019b1b058707 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 >--- > 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
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