Bug 33966 - "Update and run SQL" for non-English templates
Summary: "Update and run SQL" for non-English templates
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords: rel_23_05_candidate
Depends on: 23824
Blocks: 35936
  Show dependency treegraph
 
Reported: 2023-06-08 21:47 UTC by Katrin Fischer
Modified: 2024-01-30 09:04 UTC (History)
5 users (show)

See Also:
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


Attachments
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates (2.49 KB, patch)
2023-06-09 13:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates (2.54 KB, patch)
2023-06-10 18:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33966: (bug 23824 follow-up) Fix submit buttons for translated templates (2.58 KB, patch)
2023-06-11 13:42 UTC, Andrii Nugged
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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.