Bug 21635: [sql_modes] Remove GROUP BY clause in batchMod.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 23 Oct 2018 13:35:24 +0000 (10:35 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 26 Oct 2018 16:30:07 +0000 (16:30 +0000)
commitdab4426457578094eb5aac6531d1a1db631d05c7
tree675dfdb7f029ad61def5c4da94cec71e716841d0
parentd71fb84f6fb40f7eb59a9f86f1a07d57f58f3c0a
Bug 21635: [sql_modes] Remove GROUP BY clause in batchMod.pl

batchMod.pl: DBD::mysql::st execute failed: 'koha_kohadev.authorised_values.authorised_val
ue' isn't in GROUP BY [for Statement "SELECT authorised_value, lib FROM authorised_values LEFT JOIN authorised_values_branches ON ( id = av_id )  WHERE category = ? AND ( branchcode = ? OR branchcode IS NULL )
GROUP BY lib ORDER BY lib, lib_opac" with ParamValues: 0='WITHDRAWN', 1="CPL"] at /home/vagrant/kohaclone/tools/batchMod.pl line 396.

We must use Koha::AuthorisedValues->search instead of a raw SQL query.

Test plan:
Edit some items in a batch
Confirm that the dropdown list (AV) are correctly filled

We will lose speed efficiency here, but better to be consistent, then cache AV in Koha::AuthorisedValues

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
tools/batchMod.pl