Bugzilla – Attachment 152084 Details for
Bug 33901
Only one issue shown when testing prediction pattern
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today
Bug-33901-bug-30718-follow-up-Predition-pattern---.patch (text/plain), 1.88 KB, created by
Jonathan Druart
on 2023-06-07 09:52:37 UTC
(
hide
)
Description:
Bug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-06-07 09:52:37 UTC
Size:
1.88 KB
patch
obsolete
>From 276de9aa6b638b98f2f4e273a710c36eeb351632 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 7 Jun 2023 11:49:41 +0200 >Subject: [PATCH] Bug 33901: (bug 30718 follow-up) Predition pattern - don't > set end date to today > >If the end date is not set we should not set it to today. >On bug 30718 the following change was wrong: >-$enddate = eval { output_pref( { str => $enddate, dateonly => 1, dateformat => 'iso' } ); }; >+$enddate = dt_from_string($enddate)->ymd; > >output_pref returns undef if str is empty >After the change we returned today's date. > >Test plan: >1. Go to Serials > Manage numbering patterns >2. Click Edit next to one of the existing patterns (e.g. Number) >3. Enter information in the Test prediction pattern section > - Frequency: choose one (e.g. 1/month) > - First issue publication date: enter a date (e.g. 2023-06-01) > - Subscription length: issues + enter a number of issues (e.g. 12) > - Locale: leave empty > - Begins with: enter a number in the X column, e.g. 42 >4. Click Test pattern >=> Without this patch only one issue is shown, no matter how many you enter in Subscription length >=> With this patch applied the end date is not set to today and the >prediction pattern list is correct >--- > serials/showpredictionpattern.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/serials/showpredictionpattern.pl b/serials/showpredictionpattern.pl >index e553ee12694..9fc801102be 100755 >--- a/serials/showpredictionpattern.pl >+++ b/serials/showpredictionpattern.pl >@@ -92,7 +92,7 @@ my %pattern = ( > > $firstacquidate = $firstacquidate ? dt_from_string($firstacquidate)->ymd : dt_from_string->ymd; > >-$enddate = dt_from_string($enddate)->ymd; >+$enddate = dt_from_string($enddate)->ymd if $enddate; > > $nextacquidate = $nextacquidate ? dt_from_string($nextacquidate)->ymd : $firstacquidate; > my $date = $nextacquidate; >-- >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 33901
:
152084
|
152105
|
152217