Koha-clms/reports
Michael Hafen 6ccbdce5c0 Bug 28977: Fix cat_issues_top.pl report with strict SQL modes
To get the 'Most circulated items' report to run in ONLY_FULL_GROUP_BY
Sql mode.

Test plan:

Turn on strict_sql_modes ( make sure <strict_sql_modes> is 1 in KOHA_CONF )
Go to Reports -> Most circulated items
submit the form.

Without the patch you get an error like:
CGI::Compile::ROOT::usr_local_koha_master_reports_cat_issues_top_2epl::calculate(): DBI Exception: DBD::mysql::st execute failed: Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'koha_main_v4.items.itemcallnumber' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [for Statement "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID, itemcallnumber as CALLNUM, ccode as CCODE, location as LOC FROM `old_issues`
                  LEFT JOIN items USING(itemnumber)
                  LEFT JOIN biblio USING(biblionumber)
                  LEFT JOIN biblioitems USING(biblionumber)
                  LEFT JOIN borrowers USING(borrowernumber)
                  WHERE 1 AND old_issues.issuedate > '2020-08-03' AND old_issues.issuedate < '2021-05-17' AND old_issues.returndate > '2020-08-27' AND old_issues.returndate < '2021-06-01' AND old_issues.branchcode like '403' AND items.itype like 'F' AND ccode like 'FIC' AND borrowers.categorycode like 'ST' group by biblio.biblionumber order by `RANK` DESC"] at /usr/local/koha_master/reports/cat_issues_top.pl line 67
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

With the patch you will see the report results view.

Signed-off-by: David Nind <david@davidnind.com>

JD Amended patch - adjust commit's title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7745ef03ad)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2022-02-21 16:30:35 +00:00
..
acquisitions_stats.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
bor_issues_top.pl Bug 28523: Escape 'rank' in bor_issues_top.pl 2021-07-09 12:29:15 -04:00
borrowers_out.pl Bug 23271: Replace search_limited with search_with_library_limits 2021-04-21 15:25:07 +02:00
borrowers_stats.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
cash_register_stats.pl Bug 29271: (QA follow-up) Fetch and send descriptions to template 2021-10-22 11:27:48 -04:00
cat_issues_top.pl Bug 28977: Fix cat_issues_top.pl report with strict SQL modes 2022-02-21 16:30:35 +00:00
catalogue_out.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
catalogue_stats.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
dictionary.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
guided_reports.pl Bug 28804: (bug 25026 follow-up) Handle SQL errors in reports 2021-08-13 07:28:41 -04:00
issues_avg_stats.pl Bug 7806: Fix remaining occurrences of 0000-00-00 2021-03-01 11:16:42 +01:00
issues_stats.pl Bug 29204: (QA follow-up) Fix variable name 2021-11-19 10:49:58 -05:00
itemslost.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
itemtypes.plugin Bug 26090: Fix "item types" report 2020-08-18 14:38:41 +02:00
manager.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
orders_by_fund.pl Bug 27486: Rename system preference delimiter to CSVDelimiter 2021-01-29 09:03:45 +01:00
reports-home.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
reserves_stats.pl Bug 23271: Replace search_limited with search_with_library_limits 2021-04-21 15:25:07 +02:00
serials_stats.pl Bug 28216: Fix vendor list group by in serials statistics wizard 2021-12-17 20:55:03 +00:00