Bug 25335

Summary: Use of an authorised value in a marc subfield causes strict mode SQL error
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: CatalogingAssignee: Andrew Fuerste-Henry <andrewfh>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: 1joynelson, lucas, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11
Bug Depends on:    
Bug Blocks: 17258    
Attachments: Bug 25335: group by authorised_value in addbiblio.pl
Bug 25335: group by authorised_value in addbiblio.pl
Bug 25335: group by authorised_value in addbiblio.pl

Description Andrew Fuerste-Henry 2020-04-30 19:33:25 UTC
To recreate:
- Edit your default framework, connect any subfield outside of the 952 to an authorised value (for example, connect the 942$n to the Yes_No auth value)
- Find a record in that framework
- Edit the record and find your subfield
- The subfield shows a dropdown with no contents
- check plack log, see "DBD::mysql::st execute failed: 'koha_kohadev.authorised_values.authorised_value' isn't in GROUP BY "
Comment 1 Andrew Fuerste-Henry 2020-04-30 19:38:25 UTC
Created attachment 104051 [details] [review]
Bug 25335: group by authorised_value in addbiblio.pl

To Test:
1- Edit your default framework, connect any subfield outside of the 952 to an authorised value (for example, connect the 942$n to the Yes_No auth value)
2 - Find a record in that framework
3 - Edit the record and find your subfield
4 - The subfield shows a dropdown with no contents
5 - check plack log, see "DBD::mysql::st execute failed: 'koha_kohadev.authorised_values.authorised_value' isn't in GROUP BY "
6 - apply patch, restart all
7 - reload edit record page, see your auth value dropdown has contents
Comment 2 David Nind 2020-05-01 11:48:35 UTC
Created attachment 104077 [details] [review]
Bug 25335: group by authorised_value in addbiblio.pl

To Test:
1- Edit your default framework, connect any subfield outside of the 952 to an authorised value (for example, connect the 942$n to the Yes_No auth value)
2 - Find a record in that framework
3 - Edit the record and find your subfield
4 - The subfield shows a dropdown with no contents
5 - check plack error log, see "DBD::mysql::st execute failed: 'koha_kohadev.authorised_values.authorised_value' isn't in GROUP BY "
6 - apply patch, restart all
7 - reload edit record page, see your auth value dropdown has contents

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2020-05-03 20:56:23 UTC
Created attachment 104231 [details] [review]
Bug 25335: group by authorised_value in addbiblio.pl

To Test:
1- Edit your default framework, connect any subfield outside of the 952 to an authorised value (for example, connect the 942$n to the Yes_No auth value)
2 - Find a record in that framework
3 - Edit the record and find your subfield
4 - The subfield shows a dropdown with no contents
5 - check plack log, see "DBD::mysql::st execute failed: 'koha_kohadev.authorised_values.authorised_value' isn't in GROUP BY "
6 - apply patch, restart all
7 - reload edit record page, see your auth value dropdown has contents

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2020-05-03 20:56:38 UTC
Good catch!
Comment 5 Martin Renvoize 2020-05-04 07:55:37 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 6 Joy Nelson 2020-05-11 20:35:52 UTC
Backported to 19.11.x for 19.11.06
Comment 7 Lucas Gass 2020-05-15 20:04:26 UTC
backported to 19.05.x for 19.05.11