Bug 26090 - Catalog by itemtype report fails if SQL strict mode is on
Summary: Catalog by itemtype report fails if SQL strict mode is on
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 17258
  Show dependency treegraph
 
Reported: 2020-07-29 15:32 UTC by Owen Leonard
Modified: 2021-06-14 21:30 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.04, 19.11.10, 19.05.15
Circulation function:


Attachments
Bug 26090: Fix "item types" report (3.97 KB, patch)
2020-07-30 12:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26090: Fix "item types" report (4.03 KB, patch)
2020-08-11 12:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26090: Fix "item types" report (4.08 KB, patch)
2020-08-13 13:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-07-29 15:32:40 UTC
The catalog by itemtype report (reports/manager.pl?report_name=itemtypes) returns no results if SQL strict mode is on.
Comment 1 Jonathan Druart 2020-07-30 12:37:08 UTC
Created attachment 107581 [details] [review]
Bug 26090: Fix "item types" report

This report was broken with SQL strict mode, but also without.

DBD::mysql::st execute failed: 'koha_kohadev.itemtypes.itemtype' isn't in GROUP BY [for Statement "
and, if no library was selected:
DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'field list' [for Statement "

This patch does the minimum to make it usable, but it would need more love.

Test plan:
To test you will need to try the 4 combinaisons:
 item-level_itypes = item or biblio
 With or without a library selected in the dropdown list
Comment 2 Owen Leonard 2020-08-11 12:03:11 UTC
Created attachment 108053 [details] [review]
Bug 26090: Fix "item types" report

This report was broken with SQL strict mode, but also without.

DBD::mysql::st execute failed: 'koha_kohadev.itemtypes.itemtype' isn't
in GROUP BY [for Statement "

and, if no library was selected:

DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in
'field list' [for Statement "

This patch does the minimum to make it usable, but it would need more
love.

Test plan:
To test you will need to try the 4 combinaisons:
 item-level_itypes = item or biblio
 With or without a library selected in the dropdown list

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Martin Renvoize (ashimema) 2020-08-13 13:21:08 UTC
Created attachment 108180 [details] [review]
Bug 26090: Fix "item types" report

This report was broken with SQL strict mode, but also without.

DBD::mysql::st execute failed: 'koha_kohadev.itemtypes.itemtype' isn't
in GROUP BY [for Statement "

and, if no library was selected:

DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in
'field list' [for Statement "

This patch does the minimum to make it usable, but it would need more
love.

Test plan:
To test you will need to try the 4 combinaisons:
 item-level_itypes = item or biblio
 With or without a library selected in the dropdown list

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2020-08-13 13:21:52 UTC
The fix works as expected and passes QA scripts.. as a major I think lets get this in as is and we can followup later with more of a cleanup patch.

Passing QA
Comment 5 Jonathan Druart 2020-08-18 15:47:25 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Lucas Gass (lukeg) 2020-09-03 14:37:13 UTC
backported to 20.05.x for 20.05.04
Comment 7 Aleisha Amohia 2020-09-09 03:59:15 UTC
backported to 19.11.x for 19.11.10
Comment 8 Victor Grousset/tuxayo 2020-09-20 15:41:55 UTC
Backported to 19.05.x branch for 19.05.15