[Bug 17257] New: Cannot create a patron under MySQL 5.7
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Bug ID: 17257 Summary: Cannot create a patron under MySQL 5.7 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org DBD::mysql::st execute failed: Incorrect integer value: '' for column 'guarantorid' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17258 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17258 [Bug 17258] [OMIBUS] MySQL 5.7 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 55231 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55231&action=edit Bug 17257: Fix add/edit patrons under MySQL 5.7 If no guarantor is defined the patron won't be added/modified and an error will be raised: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'guarantorid' Test plan: Using MySQL 5.7 (and/or sql_mode=STRICT_TRANS_TABLES) Create a patron without guarantor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hblancoca@gmail.com --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 16094 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |srdjan@catalyst.net.nz --- Comment #3 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- I don't have mysql (running mariadb), and wondering how come DBIx::Class did not solve it? Anyway, if it is a problem, I think Koha::Patron is the place to solve it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Srdjan Jankovic from comment #3)
I don't have mysql (running mariadb), and wondering how come DBIx::Class did not solve it?
If the key exists, the default value defined at DB level is not used.
Anyway, if it is a problem, I think Koha::Patron is the place to solve it.
I do not understand, we are not using Koha::Patron here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #5 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #4)
(In reply to Srdjan Jankovic from comment #3)
I don't have mysql (running mariadb), and wondering how come DBIx::Class did not solve it?
If the key exists, the default value defined at DB level is not used.
Ah I see. Then maybe delete $data{'dateofbirth'} if exists($data{'dateofbirth') && !$data{'dateofbirth'}; would make intention clearer.
I do not understand, we are not using Koha::Patron here.
A couple of lines later: my $patron = Koha::Patron->new( $new_member )->store; Considering the line number mismatch, I'd say base for this patch is lagging a bit. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Srdjan Jankovic from comment #5)
(In reply to Jonathan Druart from comment #4)
(In reply to Srdjan Jankovic from comment #3)
I don't have mysql (running mariadb), and wondering how come DBIx::Class did not solve it?
If the key exists, the default value defined at DB level is not used.
Ah I see. Then maybe
delete $data{'dateofbirth'} if exists($data{'dateofbirth') && !$data{'dateofbirth'};
would make intention clearer.
I just mimic what existed before.
I do not understand, we are not using Koha::Patron here.
A couple of lines later:
my $patron = Koha::Patron->new( $new_member )->store;
Considering the line number mismatch, I'd say base for this patch is lagging a bit.
As I said, I just mimic what existed before. The plan is to move C4::Members::AddMember to Koha::Patron, of course. But that patch is just supposed to be a bugfix. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #55231|0 |1 is obsolete| | --- Comment #7 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 61425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61425&action=edit [SIGNED-OFF] Bug 17257: Fix add/edit patrons under MySQL 5.7 If no guarantor is defined the patron won't be added/modified and an error will be raised: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'guarantorid' Test plan: Using MySQL 5.7 (and/or sql_mode=STRICT_TRANS_TABLES) Create a patron without guarantor Signed-off-by: Srdjan <srdjan@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #8 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #6)
As I said, I just mimic what existed before. The plan is to move C4::Members::AddMember to Koha::Patron, of course. But that patch is just supposed to be a bugfix. I understand. In that light I think it would be better to fix it in Koha::Patron rather than adding more code to a legacy module. Especially when you can add it elegantly to Patron::new(), bonus moving similar lines too - a micro-refactoring that will make moving AddMember to Patroms easier.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Thanks for volunteering :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 63382 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63382&action=edit Bug 17257: Fix add/edit patrons under MySQL 5.7 If no guarantor is defined the patron won't be added/modified and an error will be raised: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'guarantorid' Test plan: Using MySQL 5.7 (and/or sql_mode=STRICT_TRANS_TABLES) Create a patron without guarantor Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Tested with MariaDB 10.0.30 (sql_mode='STRICT_TRANS_TABLES') Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Attachment #61425|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |katrin.fischer@bsz-bw.de --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This patch has been pushed to 16.11.x and will be in 16.11.08. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #13 from Julian Maurice <julian.maurice@biblibre.com> --- Pushed to 3.22.x for 3.22.21 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17257 --- Comment #14 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.13 release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org