Bug 20180

Summary: Remove GROUP BY clause in manage-marc-import.pl
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Julian Maurice <julian.maurice>
Severity: normal    
Priority: P5 - low CC: martin.renvoize
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20144
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 17258, 20521    
Attachments: Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl

Description Julian Maurice 2018-02-12 13:58:53 UTC
This bug is a continuation of bug 20144
Comment 1 Julian Maurice 2018-02-12 14:00:04 UTC
Created attachment 71472 [details] [review]
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl

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

t/db_dependent/www/search_utf8.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 2 Julian Maurice 2018-02-12 14:01:06 UTC
The GROUP BY is needed here, otherwise you have the same MARC framework displayed multiple times in the dropdown list.
Comment 3 Jonathan Druart 2018-02-14 17:54:22 UTC
Created attachment 71625 [details] [review]
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl

Replaced with a distinct.

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

t/db_dependent/www/search_utf8.t
Comment 4 Mark Tompsett 2018-03-19 03:40:53 UTC
Comment on attachment 71625 [details] [review]
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl

Review of attachment 71625 [details] [review]:
-----------------------------------------------------------------

::: tools/manage-marc-import.pl
@@ +62,4 @@
>  our $sessionID = $cookies{'CGISESSID'}->value;
>  our $dbh = C4::Context->dbh;
>  
> +my $frameworks = Koha::BiblioFrameworks->search({ tagfield => { 'not' => undef } }, { join => 'marc_tag_structure', distinct => 'frameworkcode', order_by => ['frameworktext'] });

Ah! You need the join to confirm there are actually fields to be used for importing. Otherwise, you do lots of work to import nothing.
Comment 5 Mark Tompsett 2018-03-21 05:40:31 UTC
Created attachment 73130 [details] [review]
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl

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>
Comment 6 Julian Maurice 2018-04-09 11:59:06 UTC
Created attachment 73860 [details] [review]
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl

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>
Comment 7 Jonathan Druart 2018-04-09 19:16:49 UTC
Pushed to master for 18.05, thanks to everybody involved!