Bugzilla – Attachment 51642 Details for
Bug 16550
Can't set opac news expiration date to NULL, it reverts to today
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16550: Can't set opac news expiration date to NULL, it reverts to today
Bug-16550-Cant-set-opac-news-expiration-date-to-NU.patch (text/plain), 2.29 KB, created by
Marc Véron
on 2016-05-20 10:26:34 UTC
(
hide
)
Description:
Bug 16550: Can't set opac news expiration date to NULL, it reverts to today
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-05-20 10:26:34 UTC
Size:
2.29 KB
patch
obsolete
>From 4bdb0468544a053cb1ea250aa2cf0da6f24b8b9e Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Fri, 20 May 2016 12:19:36 +0200 >Subject: [PATCH] Bug 16550: Can't set opac news expiration date to NULL, it > reverts to today > >This patch fixes an issue with the expiration dates for news always reverting to today if empty. > >To test: >- Apply patch >- Go to Home > Tools > News >- Create a news item, do not set expiration date >- Verify that expiration date stays empty >- Edit this news item >- Do not set expiration date >- Verify that expiration date stays empty >- Do the same with expiration dates >- Verify that they are saved properly >--- > C4/NewsChannels.pm | 2 +- > tools/koha-news.pl | 5 ++++- > 2 files changed, 5 insertions(+), 2 deletions(-) > >diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm >index cbcc702..8e261db 100644 >--- a/C4/NewsChannels.pm >+++ b/C4/NewsChannels.pm >@@ -134,7 +134,7 @@ sub get_opac_new { > $sth->execute($idnew); > my $data = $sth->fetchrow_hashref; > $data->{$data->{'lang'}} = 1 if defined $data->{lang}; >- $data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 }); >+ $data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 }) if ( $data->{expirationdate} ); > $data->{timestamp} = output_pref({ dt => dt_from_string( $data->{timestamp} ), dateonly => 1 }) ; > return $data; > } >diff --git a/tools/koha-news.pl b/tools/koha-news.pl >index d5f2c5b..7074f9d 100755 >--- a/tools/koha-news.pl >+++ b/tools/koha-news.pl >@@ -40,7 +40,10 @@ my $cgi = new CGI; > my $id = $cgi->param('id'); > my $title = $cgi->param('title'); > my $new = $cgi->param('new'); >-my $expirationdate = output_pref({ dt => dt_from_string( scalar $cgi->param('expirationdate') ), dateformat => 'iso', dateonly => 1 }); >+my $expirationdate; >+if ( scalar $cgi->param('expirationdate') ) { >+ $expirationdate = output_pref({ dt => dt_from_string( scalar $cgi->param('expirationdate') ), dateformat => 'iso', dateonly => 1 }); >+} > my $timestamp = output_pref({ dt => dt_from_string( scalar $cgi->param('timestamp') ), dateformat => 'iso', dateonly => 1 }); > my $number = $cgi->param('number'); > my $lang = $cgi->param('lang'); >-- >1.7.10.4
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 16550
:
51642
|
51650
|
51655
|
51656
|
51668
|
51669
|
51670