Bug 28258

Summary: Bad date formatting in AUTO_RENEWALS notice
Product: Koha Reporter: Nick Clemens <nick>
Component: NoticesAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.06,20.05.12
Bug Depends on: 24378    
Bug Blocks:    
Attachments: Bug 28258: Update bad formatting in AUTO_RENEWALS notice
Bug 28258: Update bad formatting in AUTO_RENEWALS notice
Bug 28258: Fix existing occurrence
Bug 28258: Update bad formatting in AUTO_RENEWALS notice
Bug 28258: Fix existing occurrence

Description Nick Clemens 2021-04-28 19:11:37 UTC
Bug 24378 updated the AUTO_RENEWALS notice to formate the date as a due date, however, it seem to have an error:

[% checkout.date_due as_due_date => 1 %] 

Generates an error:
ERROR PROCESSING TEMPLATE: file error - parse error - input text line 18: unexpected token (as_due_date)
  [% checkout.date_due as_due_date => 1 %] at test.pl line 18.


I think it should be:
[% checkout.date_due | $KohaDates as_due_date => 1%]
Comment 1 Lucas Gass 2021-04-28 20:51:35 UTC
Created attachment 120292 [details] [review]
Bug 28258: Update bad formatting in AUTO_RENEWALS notice

To test:
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due as_due_date => 1 %]
-Apply patch, updatedatabase
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due | $KohaDates as_due_date => 1%]
Comment 2 Jonathan Druart 2021-04-29 08:34:52 UTC
Oops, sorry!
Comment 3 Jonathan Druart 2021-04-29 08:47:33 UTC
Created attachment 120296 [details] [review]
Bug 28258: Update bad formatting in AUTO_RENEWALS notice

To test:
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due as_due_date => 1 %]
-Apply patch, updatedatabase
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due | $KohaDates as_due_date => 1%]

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Jonathan Druart 2021-04-29 08:47:38 UTC
Created attachment 120297 [details] [review]
Bug 28258: Fix existing occurrence

I think it's good to fix the original problem as well

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Nick Clemens 2021-04-29 10:13:59 UTC
Created attachment 120301 [details] [review]
Bug 28258: Update bad formatting in AUTO_RENEWALS notice

To test:
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due as_due_date => 1 %]
-Apply patch, updatedatabase
-Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due | $KohaDates as_due_date => 1%]

Additional test:
1 - Checkout an item to a patron
2 - Find their borrowernumber, the itemnumber, and the biblionumber
3 - Use the get_prepared_letter script to test the letter content
    perl misc/devel/get_prepared_letter.pl --module circulation --letter-code AUTO_RENEWALS --tables="{\"borrowers\": 5,\"issues\": 1040,\"items\": 1040,\"biblio\": 2 }"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens 2021-04-29 10:14:04 UTC
Created attachment 120302 [details] [review]
Bug 28258: Fix existing occurrence

I think it's good to fix the original problem as well

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Jonathan Druart 2021-04-30 15:18:28 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-05-11 10:06:20 UTC
Pushed to 20.11.x for 20.11.06
Comment 9 Victor Grousset/tuxayo 2021-05-25 14:01:24 UTC
note: was pushed to 20.05.x for 20.05.12
Comment 10 Victor Grousset/tuxayo 2021-05-25 14:01:31 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.