Bug 20180 - Remove GROUP BY clause in manage-marc-import.pl
Summary: Remove GROUP BY clause in manage-marc-import.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Julian Maurice
URL:
Keywords:
Depends on:
Blocks: 17258 20521
  Show dependency treegraph
 
Reported: 2018-02-12 13:58 UTC by Julian Maurice
Modified: 2019-10-14 19:57 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl (1.20 KB, patch)
2018-02-12 14:00 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl (1.20 KB, patch)
2018-02-14 17:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl (1.43 KB, patch)
2018-03-21 05:40 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl (1.50 KB, patch)
2018-04-09 11:59 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!