@@ -, +, @@ OPAC without Publication date --- Koha/AdditionalContents.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/Koha/AdditionalContents.pm +++ a/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}; --