Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 7 Feb 2018 15:26:53 +0000 (12:26 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 9 Apr 2018 19:15:17 +0000 (16:15 -0300)
Replaced with a distinct.

Fix for:
'koha_kohadev.me.frameworktext' isn't in GROUP BY

t/db_dependent/www/search_utf8.t

NOTE: I added a [% frameworks.count %] into the template file,
      and compared master and a branch with this applied when
      managing a staged marc import. Values were identical.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

tools/manage-marc-import.pl

index d503a5e..4fea400 100755 (executable)
@@ -62,7 +62,7 @@ my %cookies = parse CGI::Cookie($cookie);
 our $sessionID = $cookies{'CGISESSID'}->value;
 our $dbh = C4::Context->dbh;
 
-my $frameworks = Koha::BiblioFrameworks->search({ tagfield => { 'not' => undef } }, { join => 'marc_tag_structure', group_by=>'frameworkcode',order_by => ['frameworktext'] });
+my $frameworks = Koha::BiblioFrameworks->search({ tagfield => { 'not' => undef } }, { join => 'marc_tag_structure', distinct => 'frameworkcode', order_by => ['frameworktext'] });
 $template->param( frameworks => $frameworks );
 
 if ($op eq "create_labels") {