Bug 30583

Summary: Hold system broken for translated template
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Hold requestsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: blocker    
Priority: P5 - low CC: andrewfh, gmcharlt, kyle, lucas, tomascohen, victor
Version: unspecifiedKeywords: rel_21_05_candidate, rel_21_11_candidate
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.05,21.05.14
Bug Depends on: 29338    
Bug Blocks:    
Attachments: Bug 30583: Fix hold system for translated templates
Bug 30583: Fix hold system for translated templates
Bug 30583: Fix hold system for translated templates

Description Jonathan Druart 2022-04-21 14:27:40 UTC
With es-ES:
Template process failed: file error - parse error - holds_table.inc line 216-217: unexpected token (hold)                                                                                                              [% " hold.reserve_id="hold.reserve_id" html="html" name="printholdslip" type="button" value="Recibo" |="|"></td>                                                              
 [% ELSE %] at /kohadevbox/koha/C4/Templates.pm line 127
Comment 1 Jonathan Druart 2022-04-21 14:29:35 UTC
Caused by
  commit a68021a2387ff1caf854c17fc5331e85926c1f7e
  Bug 29338: Add print hold/transfer button to request.tt
Comment 2 Jonathan Druart 2022-04-21 14:32:12 UTC
Created attachment 133569 [details] [review]
Bug 30583: Fix hold system for translated templates

There are missing quotes, and the translate script is messing up with
the generated template.

Error is:
Template process failed: file error - parse error - holds_table.inc line 216-217: unexpected token (hold)

The generated line, without this patch is:
216 <td><input %]="%]" class="printholdslip" data-reserve_id="[%" hold.reserve_id="hold.reserve_id" html="html" name="printholdslip" type="button" value="Recibo" |="|"></td>
With this patch applied:
216  <td><input class="printholdslip" data-reserve_id="[% hold.reserve_id | html %]" name="printholdslip" type="button" value="Recibo"></td>
Comment 3 Lucas Gass 2022-04-21 14:43:03 UTC
Created attachment 133570 [details] [review]
Bug 30583: Fix hold system for translated templates

There are missing quotes, and the translate script is messing up with
the generated template.

Error is:
Template process failed: file error - parse error - holds_table.inc line 216-217: unexpected token (hold)

The generated line, without this patch is:
216 <td><input %]="%]" class="printholdslip" data-reserve_id="[%" hold.reserve_id="hold.reserve_id" html="html" name="printholdslip" type="button" value="Recibo" |="|"></td>
With this patch applied:
216  <td><input class="printholdslip" data-reserve_id="[% hold.reserve_id | html %]" name="printholdslip" type="button" value="Recibo"></td>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Lucas Gass 2022-04-21 14:43:34 UTC
Thanks Jonathan, sorry about that one :(
Comment 5 Tomás Cohen Arazi 2022-04-21 16:05:29 UTC
Created attachment 133587 [details] [review]
Bug 30583: Fix hold system for translated templates

There are missing quotes, and the translate script is messing up with
the generated template.

Error is:
Template process failed: file error - parse error - holds_table.inc line 216-217: unexpected token (hold)

The generated line, without this patch is:
216 <td><input %]="%]" class="printholdslip" data-reserve_id="[%" hold.reserve_id="hold.reserve_id" html="html" name="printholdslip" type="button" value="Recibo" |="|"></td>
With this patch applied:
216  <td><input class="printholdslip" data-reserve_id="[% hold.reserve_id | html %]" name="printholdslip" type="button" value="Recibo"></td>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Fridolin Somers 2022-04-21 23:42:30 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 7 Kyle M Hall 2022-04-25 19:05:54 UTC
Pushed to 21.11.x for 21.11.05
Comment 8 Andrew Fuerste-Henry 2022-04-25 19:35:52 UTC
Pushed to 21.05.x for 21.05.14
Comment 9 Victor Grousset/tuxayo 2022-04-25 20:50:32 UTC
Missing dependencies for 20.11.x, it shouldn't be affected, no backport.
Bullet dodged :)