Bug 28198 - Sample notices SQL fails on HOLD_REMINDER: Column count doesn't match value count
Summary: Sample notices SQL fails on HOLD_REMINDER: Column count doesn't match value c...
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 15986
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-22 18:23 UTC by Victor Grousset/tuxayo
Modified: 2021-04-30 08:31 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.05.00


Attachments
Bug 28198: Correct sample HOLD_REMINDER notice for French (3.75 KB, patch)
2021-04-26 18:22 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28198: Correct sample HOLD_REMINDER notice for French (3.81 KB, patch)
2021-04-27 01:20 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 28198: Correct sample HOLD_REMINDER notice for it,nb,pl,ru (14.09 KB, patch)
2021-04-27 01:20 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Grousset/tuxayo 2021-04-22 18:23:58 UTC
DBD::mysql::st execute failed: Column count doesn't match value count at row 15

Row 15 is
koha_1       | ('reserves','HOLD_REMINDER','','Waiting hold reminder',0,'You have waiting holds.','Dear [% borrower.firstname %] [% borrower.surname %],\r\n\r\nThe follwing holds are waiting at [% branch.branchname %]:\r\n\\r\n[% FOREACH hold IN holds %]\r\n    [% hold.biblio.title %] : waiting since [% hold.waitingdate %]\r\n[% END %]','email'),

Git bisect showed that the error is since
ea6467724cf8e6fac2224e1dcb6c6ddee73736af
Bug 15986: Add sample notice to translated notices

Which added the line on row 15

Test plan (with koha testing docker):
1. in .env file set KOHA_MARC_FLAVOUR=unimarc
2. start the instance
3. fail!

Full error messages:
https://privatebin.deblan.org/?7e440eb0ce80f1f4#6sRbG9qywKQjCNDDHiDSWcrFneDCJBs96GuxqqKvzHu8

Not sure about criticality. Maybe it should be higher that "normal" since it hinders testing unimarc stuff
Comment 1 Victor Grousset/tuxayo 2021-04-26 14:18:22 UTC
note: workaround: remove from installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
The line:
('reserves','HOLD_REMINDER','','Waiting hold reminder',0,'You have waiting holds.','Dear [% borrower.firstname %] [% borrower.surname %],\r\n\r\nThe following holds are waiting at [% branch.branchname %]:\r\n\\r\n[% FOREACH hold IN holds %]\r\n    [% hold.biblio.title %] : waiting since [% hold.waitingdate | $KohaDates %]\r\n[% END %]','email'),
Comment 2 Nick Clemens 2021-04-26 18:22:07 UTC
Created attachment 120183 [details] [review]
Bug 28198: Correct sample HOLD_REMINDER notice for French

To test:
1 - sudo koha-mysql kohadev
2 - DELETE FROM letter
3 - cat installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql | sudo koha-mysql kohadev
4 - Error!
5 - Apply patch
6 - Repeat 1-3
7 - Success!
Comment 3 Victor Grousset/tuxayo 2021-04-27 01:20:53 UTC
Created attachment 120187 [details] [review]
Bug 28198: Correct sample HOLD_REMINDER notice for French

To test:
1 - sudo koha-mysql kohadev
2 - DELETE FROM letter
3 - cat installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql | sudo koha-mysql kohadev
4 - Error!
5 - Apply patch
6 - Repeat 1-3
7 - Success!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 4 Victor Grousset/tuxayo 2021-04-27 01:20:57 UTC
Created attachment 120188 [details] [review]
Bug 28198: Correct sample HOLD_REMINDER notice for it,nb,pl,ru

It turns out that ea6467724cf8e6fac2224e1dcb6c6ddee73736af also caused the same issue in these locales
Also e0b0e908f767e510c5538d8e5cfb25f994579441 (a follow up) caused the issue in it-IT

== Test plan ==
Paste all this :D
```
 # doesn't work without this patch applied
echo "DELETE FROM letter;" | sudo koha-mysql kohadev
cat installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql | sudo koha-mysql kohadev
echo "DELETE FROM letter;" | sudo koha-mysql kohadev
cat installer/data/mysql/pl-PL/mandatory/sample_notices.sql | sudo koha-mysql kohadev
echo "DELETE FROM letter;" | sudo koha-mysql kohadev
cat installer/data/mysql/ru-RU/mandatory/sample_notices.sql | sudo koha-mysql kohadev
echo "DELETE FROM letter;" | sudo koha-mysql kohadev
cat installer/data/mysql/it-IT/necessari/notices.sql | sudo koha-mysql kohadev

 # test all the rest
 ## fixed by previous patch, double checking
echo "DELETE FROM letter;" | sudo koha-mysql kohadev
cat installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql | sudo koha-mysql kohadev
 ## was already working, just double checking
echo "DELETE FROM letter;" | sudo koha-mysql kohadev
cat installer/data/mysql/fr-CA/obligatoire/sample_notices.sql | sudo koha-mysql kohadev
echo "DELETE FROM letter;" | sudo koha-mysql kohadev
cat installer/data/mysql/uk-UA/mandatory/sample_notices.sql | sudo koha-mysql kohadev
```
Comment 5 Victor Grousset/tuxayo 2021-04-27 01:21:31 UTC
Thanks, it works :D, fr-FR is fixed.
Comment 6 Jonathan Druart 2021-04-27 14:27:01 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 7 Fridolin Somers 2021-04-30 08:31:58 UTC
Depends on Bug 15986 not in 20.11.x