Bugzilla – Attachment 123856 Details for
Bug 24387
Rename News tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24387: Fix Letters/TemplateToolkit.t
Bug-24387-Fix-LettersTemplateToolkitt.patch (text/plain), 2.82 KB, created by
Jonathan Druart
on 2021-08-16 13:19:34 UTC
(
hide
)
Description:
Bug 24387: Fix Letters/TemplateToolkit.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-08-16 13:19:34 UTC
Size:
2.82 KB
patch
obsolete
>From a75e82bb7ee5f5e0fbad4272962841c92561495c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 16 Aug 2021 15:17:24 +0200 >Subject: [PATCH] Bug 24387: Fix Letters/TemplateToolkit.t > >We must cast to date or the comparison does not work >--- > Koha/AdditionalContents.pm | 4 ++-- > t/db_dependent/Letters/TemplateToolkit.t | 23 ++++++++++++++--------- > 2 files changed, 16 insertions(+), 11 deletions(-) > >diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm >index fa32aa6318a..a631862b9bc 100644 >--- a/Koha/AdditionalContents.pm >+++ b/Koha/AdditionalContents.pm >@@ -72,8 +72,8 @@ sub search_for_display { > my $search_params; > $search_params->{location} = $params->{location}; > $search_params->{branchcode} = [ $params->{library_id}, undef ] if $params->{library_id}; >- $search_params->{published_on} = { '<=' => \'NOW()' }; >- $search_params->{-or} = [ expirationdate => { '>=' => \'NOW()' }, >+ $search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' }; >+ $search_params->{-or} = [ expirationdate => { '>=' => \'CAST(NOW() AS DATE)' }, > expirationdate => undef ]; > > if ( $params->{lang} ) { >diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t >index 0aa71f2e74d..04658e78999 100755 >--- a/t/db_dependent/Letters/TemplateToolkit.t >+++ b/t/db_dependent/Letters/TemplateToolkit.t >@@ -39,7 +39,7 @@ use Koha::Biblio; > use Koha::Biblioitem; > use Koha::Item; > use Koha::Hold; >-use Koha::AdditionalContent; >+use Koha::AdditionalContents; > use Koha::Serial; > use Koha::Subscription; > use Koha::Suggestion; >@@ -631,16 +631,21 @@ EOF > my $branchcode = $library->{branchcode}; > > Koha::AdditionalContents->delete; >- my $news_item = Koha::AdditionalContent->new( >+ my $news_item = $builder->build_object( > { >- branchcode => $branchcode, >- title => "A wonderful news", >- content => "This is the wonderful news.", >- lang => "slip", >- expiration_date => undef, >- published_on => $one_minute_ago >+ class => 'Koha::AdditionalContents', >+ value => { >+ category => 'news', >+ location => "slip", >+ branchcode => $branchcode, >+ lang => 'default', >+ title => "A wonderful news", >+ content => "This is the wonderful news.", >+ expiration_date => undef, >+ published_on => $one_minute_ago >+ } > } >- )->store; >+ ); > > # historic syntax > my $template = <<EOF; >-- >2.25.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 24387
:
122737
|
122738
|
122746
|
122748
|
122872
|
122873
|
122874
|
122878
|
122879
|
122880
|
123730
|
123731
|
123732
|
123733
|
123734
|
123795
|
123796
|
123797
|
123798
|
123803
|
123811
|
123854
|
123855
| 123856 |
124867
|
125545
|
142653