Bugzilla – Attachment 139824 Details for
Bug 31450
HTML customizations and news will not display on OPAC without a publication date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31450 - HTML customizations and News will not display on OPAC without Publication date
Bug-31450---HTML-customizations-and-News-will-not-.patch (text/plain), 2.14 KB, created by
Paul Derscheid
on 2022-08-26 12:30:08 UTC
(
hide
)
Description:
Bug 31450 - HTML customizations and News will not display on OPAC without Publication date
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2022-08-26 12:30:08 UTC
Size:
2.14 KB
patch
obsolete
>From 608b494a0fb8d5d3f1251de711a1741475d62d37 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Fri, 26 Aug 2022 14:28:39 +0200 >Subject: [PATCH] Bug 31450 - HTML customizations and News will not display on > OPAC without Publication date > >To test: >1) Create some HTML Customizations and some News items that are set to display on the OPAC. Create one of each: [ 'With publication date today', 'With publication date in the future', 'Without publication date' ] >2) Note that news with publication date 'today' will display; with publication date 'in the future' will not display; with publication date unset will not display. >3) Note that html_customizations with date 'today' will display; with publication date 'in the future' will not display; with publication date unset will display. >4) Sign-Off >--- > Koha/AdditionalContents.pm | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm >index a33152b3ee..2922c00e5d 100644 >--- a/Koha/AdditionalContents.pm >+++ b/Koha/AdditionalContents.pm >@@ -19,6 +19,8 @@ package Koha::AdditionalContents; > > use Modern::Perl; > >+use Data::Dumper; >+ > use Koha::Database; > use Koha::Exceptions; > use Koha::AdditionalContent; >@@ -69,10 +71,17 @@ location is one of this: > sub search_for_display { > my ( $self, $params ) = @_; > >+ warn Dumper($params); >+ > my $search_params; > $search_params->{location} = $params->{location}; > $search_params->{branchcode} = $params->{library_id} ? [ $params->{library_id}, undef ] : undef; >- $search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' }; >+ $params->{category} && $params->{category} eq 'news' >+ ? $search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' } >+ : $search_params->{-or} = [ >+ published_on => { '<=' => \'CAST(NOW() AS DATE)' }, >+ published_on => { '=' => \'NULL' } >+ ]; > $search_params->{-or} = [ expirationdate => { '>=' => \'CAST(NOW() AS DATE)' }, > expirationdate => undef ]; > $search_params->{category} = $params->{category} if $params->{category}; >-- >2.31.1
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 31450
:
139824
|
139825
|
146914
|
146915
|
146925
|
146926
|
146927
|
167754
|
167755
|
167756
|
175350
|
175379
|
175564