This error doesn't affect version 20.11.03 To reproduce: Go to Reports -> Circulation On Period select "Row" or "Column" and choose a date Submit You will have a Error 500. Logs, intranet-error.log: AH01215: main::calculate(): DBI Exception: DBD::mysql::st execute failed: Incorrect DATETIME value: '' [for Statement "SELECT distinctrow date_format(`datetime`,"%Y-%m-%d") FROM statistics LEFT JOIN borrowers ON (statistics.borrowernumber = borrowers.borrowernumber) WHERE datetime IS NOT NULL AND datetime != '' AND datetime BETWEEN ? AND ? AND type ='issue' group by date_format(`datetime`,"%Y-%m-%d") order by date_format(`datetime`,"%Y-%m-%d") " with ParamValues: 0='2021-10-01', 1='2021-10-11 23:59:59'] at /usr/share/koha/intranet/cgi-bin/reports/issues_stats.pl line 104: /usr/share/koha/intranet/cgi-bin/reports/issues_stats.pl,
Hello José Anjos! I tried to reproduce this error on the vesion and didn't receive an error with 500 code. Can you check if it's still reproducible and if yes - please provide more details
Hello José Anjos, I tried to reproduce this error on the latest vesion and didn't receive an error with 500 code. Can you check if it's still reproducible and if yes - please provide more details. Thank you!
Hi Andrii Veremeienko, I confirm the problem. I have 2 VM's with Koha and I have the problem on both now. The production VM (with the problem) have version 21.05.04 Ubuntu 20.04.03, Perl 5.03, mysql 8.0.26 The test VM (without problem) had version 20.11.03 Ubuntu 20.04.03, Perl 5.03, mysql 8.0.26 Then, to test if it was a koha version problem, I've upgraded koha to version 21.05.04. Now I have the error. To reproduce, just go to Reports -> Circulation On Period select "Row" or "Column" Choose a date or leave it blank Submit, and I get Error 500 I've tested with another language and I steal have the error. Cheers
Do you have 'strict_sql_modes' turned on in your koha configuration file?
(In reply to Jonathan Druart from comment #4) > Do you have 'strict_sql_modes' turned on in your koha configuration file? No, it's not related. It's because of MySQL 8.
Created attachment 126475 [details] [review] Bug 29204: Fix reports/issues_stats.pl for MySQL 8 Error was: Incorrect DATETIME value: '' Test plan Go to Reports -> Circulation On Period select "Row" or "Column" and choose a date Submit
Tested in my Test server and it worked fine :) Thank you
Created attachment 127409 [details] [review] Bug 29204: Fix reports/issues_stats.pl for MySQL 8 Error was: Incorrect DATETIME value: '' Test plan Go to Reports -> Circulation On Period select "Row" or "Column" and choose a date Submit Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
To be able to test this please remove the strict mode from koha-conf.xml: <strict_sql_modes>0</strict_sql_modes> Spent a while figuring out why the column/row radio button selection doesn't work.
Created attachment 127410 [details] [review] Bug 29204: (QA follow-up) Fix variable name The patch "Bug 29204: Fix reports/issues_stats.pl for MySQL 8" accidentally changed the variable name from $strsth2 to $strsth Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Created attachment 127442 [details] [review] Bug 29204: Fix reports/issues_stats.pl for MySQL 8 Error was: Incorrect DATETIME value: '' Test plan Go to Reports -> Circulation On Period select "Row" or "Column" and choose a date Submit Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 127443 [details] [review] Bug 29204: (QA follow-up) Fix variable name The patch "Bug 29204: Fix reports/issues_stats.pl for MySQL 8" accidentally changed the variable name from $strsth2 to $strsth Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice simple fix.. all works as expected. PQA
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.05
Pushed to 20.11.x for 20.11.12
Backported: Pushed to 20.05.x branch for 20.05.18
Not backporting to 19.11.x - LTS version will just backport security patches