[Bug 21596] New: Should not set "" as default for some columns during patron import
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Bug ID: 21596 Summary: Should not set "" as default for some columns during patron import Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Some columns require integer values,other are datetimes - we should not set these to a default of "" during import when they are undefined -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 80804 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80804&action=edit Bug 21596: Don't set a default of "" for NULL columns during patron import To test: 1 - dev_install must be set to 1 2 - prove -v t/db_dependent/Koha/Patrons/Import.t 3 - It fails 4 - Apply patch 5 - It passes -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21597 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21597 [Bug 21597] [OMNIBUS] Test suite is still failing with new default SQL modes -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80807 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80807&action=edit Bug 21596: Handle empty string for date_renewed when storing a patron Incorrect date value: '' for column 'date_renewed' -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80808&action=edit Bug 21596: Handle empty string for flags when storing a patron Incorrect integer value: '' for column 'flags' -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80809 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80809&action=edit Bug 21596: Handle empty string for other attributes when storing a patron lastseen, updated_on => dates gonenoaddress, login_attempts, privacy_guarantor_checkouts => [tiny]int -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80810 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80810&action=edit Bug 21596: Handle empty string for lost when storing a patron lost - should default to 0 at DB level, not null But let fix it as it for now -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- We certainly want/need to fix these issues at Koha::Patron level instead, to make sure we cover all insert cases. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80804|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=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Should not set "" as |Handle default values when |default for some columns |storing Koha::Patron |during patron import | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Test plan: 1 - dev_install must be set to 1 2 - prove -v t/db_dependent/Koha/Patrons/Import.t 3 - It fails 4 - Apply patch 5 - It passes 6 - Test importing patrons, it should work Simple way to import patrons (backup your db first please or let it go): 1 - Run a SQL report "SELECT * FROM borrowers" 2 - Save as csv 3 - Remove the borrowernumber column 4 - Import the file, patrons should match 5 - On the DB delete * FROM borrowers 6 - Import the file, should get your patrons back -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Nick Clemens <nick@bywatersolutions.com> 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=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80807|0 |1 is obsolete| | --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 80837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80837&action=edit Bug 21596: Handle empty string for date_renewed when storing a patron Incorrect date value: '' for column 'date_renewed' Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80808|0 |1 is obsolete| | --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 80838 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80838&action=edit Bug 21596: Handle empty string for flags when storing a patron Incorrect integer value: '' for column 'flags' Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80809|0 |1 is obsolete| | --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 80839 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80839&action=edit Bug 21596: Handle empty string for other attributes when storing a patron lastseen, updated_on => dates gonenoaddress, login_attempts, privacy_guarantor_checkouts => [tiny]int Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80810|0 |1 is obsolete| | --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 80840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80840&action=edit Bug 21596: Handle empty string for lost when storing a patron lost - should default to 0 at DB level, not null But let fix it as it for now Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80837|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80844 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80844&action=edit Bug 21596: Handle empty string for date_renewed when storing a patron Incorrect date value: '' for column 'date_renewed' Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80838|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80845 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80845&action=edit Bug 21596: Handle empty string for flags when storing a patron Incorrect integer value: '' for column 'flags' Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80839|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80846&action=edit Bug 21596: Handle empty string for other attributes when storing a patron lastseen, updated_on => dates gonenoaddress, login_attempts, privacy_guarantor_checkouts => [tiny]int Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80840|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80847&action=edit Bug 21596: Handle empty string for lost when storing a patron lost - should default to 0 at DB level, not null But let fix it as it for now Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I've worked through these now too.. looking good. Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21610 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21618 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21618 [Bug 21618] side-effects with timestamp columns with Test::DBIx::Class -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |npm@zefanjas.de --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 16858 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=21596 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81080 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81080&action=edit Bug 21596: Handle updated_on This has been picked from the solution proposed on bug 21610. It may not be pushed soon and so we need a fix for the failing tests (t/Auth_with_shibboleth.t) Test plan: prove -r t/Auth_with_shibboleth.t t/db_dependent/Koha/Patrons* must return green -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Please review and push this last patch to make Jenkins happy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I agree with this followup patch for now.. it makes sense to get the tests green again -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #22 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #19)
Created attachment 81080 [details] [review] Bug 21596: Handle updated_on
This has been picked from the solution proposed on bug 21610. It may not be pushed soon and so we need a fix for the failing tests (t/Auth_with_shibboleth.t)
Test plan: prove -r t/Auth_with_shibboleth.t t/db_dependent/Koha/Patrons* must return green
Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81160 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81160&action=edit Bug 21596: (follow-up) Handle updated_on Default value should only used if not exist. We got a failing test with the previous patch: # Failed test 'borrowers.updated_on should have been kept to what we set on creating' # at t/db_dependent/Patrons.t line 78. # got: '1' # expected: '0' Test plan: prove -r t/Auth_with_shibboleth.t t/db_dependent/Patrons.t t/db_dependent/Koha/Patron* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #24 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #23)
Created attachment 81160 [details] [review] Bug 21596: (follow-up) Handle updated_on
Default value should only used if not exist. We got a failing test with the previous patch: # Failed test 'borrowers.updated_on should have been kept to what we set on creating' # at t/db_dependent/Patrons.t line 78. # got: '1' # expected: '0'
Test plan: prove -r t/Auth_with_shibboleth.t t/db_dependent/Patrons.t t/db_dependent/Koha/Patron*
Pushed to master, phew :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81537 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81537&action=edit Bug 21596: (follow-up 2) Handle updated_on It seems that I have over complicated things here, now t/db_dependent/Koha/Object.t is failing Apparently everything is ok with this change. Test plan: prove -r prove -r t/db_dependent/Koha/Object.t t/Auth_with_shibboleth.t t/db_dependent/Patrons.t t/db_dependent/Koha/Patron* Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20287 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20287 [Bug 20287] Move AddMember and ModMember to Koha::Patron -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 --- Comment #26 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This depends on 20287 and would need pretty significant work to apply to 18.05.x series... I'm not sure the benefit outweighs the work involved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21596 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to Master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org