Bug 33966

Summary: "Update and run SQL" for non-English templates
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ReportsAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: andreas.jonsson, fridolin.somers, jonathan.druart, nugged, pedro.amorim
Version: MainKeywords: rel_23_05_candidate
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.01
Circulation function:
Bug Depends on: 23824    
Bug Blocks: 35936    
Attachments: Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates

Description Katrin Fischer 2023-06-08 21:47:02 UTC
Bug 23824 unfortunately introduced issues when the "Update and run SQL" button is used in translated templates.
Comment 1 Andrii Nugged 2023-06-09 08:13:01 UTC
self-quoting from 23824#c18
( https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23824#c18 )

You can not save the report editing form in non-English interfaces anymore.
I.e., this breaks how "Update" (saving form) works: in non-English Koha button's text becomes translated, what is desired for UI, but not for code,
but the hidden "non-translated" value was removed:

   <input type="hidden" name="phase" value="Update SQL" />


And, if the button's content is translated, it doesn't matches the comparison in reports/guided_reports.pl to the "phase" parameter with hardcoded "Update SQL".
Comment 2 Jonathan Druart 2023-06-09 13:31:04 UTC
Somebody working on this?
Comment 3 Jonathan Druart 2023-06-09 13:35:56 UTC
Created attachment 152248 [details] [review]
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates
Comment 4 Jonathan Druart 2023-06-09 13:36:29 UTC
This patch should work, I haven't tested it however.
Comment 5 Andrii Nugged 2023-06-10 05:37:35 UTC
I solved that on production before in templates only :), 

<input type="submit" onclick="this.value='Update SQL'" name="phase" class="btn btn-primary" value="Update SQL" />
<input type="submit" onclick="this.value='Update and run SQL'" name="phase" class="btn btn-primary" value="Update and run SQL" />

in a hacky way, :facepalm:

but now I will build our custom .deb with your patch, Jonathan, install on production, and sign-off.
Comment 6 Katrin Fischer 2023-06-10 18:58:18 UTC
Created attachment 152267 [details] [review]
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Andrii Nugged 2023-06-11 13:42:59 UTC
Created attachment 152274 [details] [review]
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Andrii Nugged <nugged@gmail.com>
Comment 8 Tomás Cohen Arazi (tcohen) 2023-06-12 14:51:51 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 9 Fridolin Somers 2023-06-20 12:37:06 UTC
Pushed to 23.05.x for 23.05.01
Comment 10 Pedro Amorim 2023-07-10 13:48:54 UTC
Missing dependencies for 22.11.x. Not pushing.