Summary: | Only one issue shown when testing prediction pattern | ||
---|---|---|---|
Product: | Koha | Reporter: | Caroline Cyr La Rose <caroline.cyr-la-rose> |
Component: | Serials | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | RESOLVED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, yach |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32554 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00,23.05.02,22.11.08
|
|
Circulation function: | |||
Bug Depends on: | 30718 | ||
Bug Blocks: | |||
Attachments: |
Bug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today
Bug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today Bug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today |
Description
Caroline Cyr La Rose
2023-06-05 16:08:30 UTC
This was wrong: -$enddate = eval { output_pref( { str => $enddate, dateonly => 1, dateformat => 'iso' } ); }; +$enddate = dt_from_string($enddate)->ymd; Created attachment 152084 [details] [review] 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 Created attachment 152105 [details] [review] 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 Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Thanks Jonathan! It's much better now Created attachment 152217 [details] [review] 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 Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Much better, thx Caroline for filing and Jonathan for the fix :) Pushed to master for 23.11. Nice work everyone, thanks! Thanks for all the hard work! Pushed to 23.05.x for the next release Nice work everyone! Pushed to oldstable for 22.11.x Still experiencing only one issue showing when testing prediction patterns in 22.11.07. Similar to bug 32554 (In reply to Sue from comment #11) > Still experiencing only one issue showing when testing prediction patterns > in 22.11.07. Similar to bug 32554 This is to be expected: see the Versions released in at the top. The fix will be included in 22.11.08. |