View | Details | Raw Unified | Return to bug 24387
Collapse All | Expand All

(-)a/Koha/AdditionalContents.pm (-2 / +2 lines)
Lines 72-79 sub search_for_display { Link Here
72
    my $search_params;
72
    my $search_params;
73
    $search_params->{location} = $params->{location};
73
    $search_params->{location} = $params->{location};
74
    $search_params->{branchcode} = [ $params->{library_id}, undef ] if $params->{library_id};
74
    $search_params->{branchcode} = [ $params->{library_id}, undef ] if $params->{library_id};
75
    $search_params->{published_on} = { '<=' => \'NOW()' };
75
    $search_params->{published_on} = { '<=' => \'CAST(NOW() AS DATE)' };
76
    $search_params->{-or} = [ expirationdate => { '>=' => \'NOW()' },
76
    $search_params->{-or} = [ expirationdate => { '>=' => \'CAST(NOW() AS DATE)' },
77
                              expirationdate => undef ];
77
                              expirationdate => undef ];
78
78
79
    if ( $params->{lang} ) {
79
    if ( $params->{lang} ) {
(-)a/t/db_dependent/Letters/TemplateToolkit.t (-10 / +14 lines)
Lines 39-45 use Koha::Biblio; Link Here
39
use Koha::Biblioitem;
39
use Koha::Biblioitem;
40
use Koha::Item;
40
use Koha::Item;
41
use Koha::Hold;
41
use Koha::Hold;
42
use Koha::AdditionalContent;
42
use Koha::AdditionalContents;
43
use Koha::Serial;
43
use Koha::Serial;
44
use Koha::Subscription;
44
use Koha::Subscription;
45
use Koha::Suggestion;
45
use Koha::Suggestion;
Lines 631-646 EOF Link Here
631
        my $branchcode = $library->{branchcode};
631
        my $branchcode = $library->{branchcode};
632
632
633
        Koha::AdditionalContents->delete;
633
        Koha::AdditionalContents->delete;
634
        my $news_item = Koha::AdditionalContent->new(
634
        my $news_item = $builder->build_object(
635
            {
635
            {
636
                branchcode      => $branchcode,
636
                class => 'Koha::AdditionalContents',
637
                title           => "A wonderful news",
637
                value => {
638
                content         => "This is the wonderful news.",
638
                    category        => 'news',
639
                lang            => "slip",
639
                    location        => "slip",
640
                expiration_date => undef,
640
                    branchcode      => $branchcode,
641
                published_on    => $one_minute_ago
641
                    lang            => 'default',
642
                    title           => "A wonderful news",
643
                    content         => "This is the wonderful news.",
644
                    expiration_date => undef,
645
                    published_on    => $one_minute_ago
646
                }
642
            }
647
            }
643
        )->store;
648
        );
644
649
645
        # historic syntax
650
        # historic syntax
646
        my $template = <<EOF;
651
        my $template = <<EOF;
647
- 

Return to bug 24387