[Bug 33053] New: Tables item_groups and recalls have a biblio_id column with a default of 0
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 Bug ID: 33053 Summary: Tables item_groups and recalls have a biblio_id column with a default of 0 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org These default biblio_ids of 0 are harmless but incorrect. The default values should be removed. -- 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=33053 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=33053 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147232 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147232&action=edit Bug 33053: Remove default value for tables item_groups and recalls These default biblio_ids of 0 are harmless but incorrect. The default values should be removed. Test Plan: 1) Apply this patch 2) prove t/db_dependent/Koha/Biblio.t 3) prove t/db_dependent/Koha/Recalls.t -- 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=33053 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- 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=33053 David Nind <david@davidnind.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=33053 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147232|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 149075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149075&action=edit Bug 33053: Remove default value for tables item_groups and recalls These default biblio_ids of 0 are harmless but incorrect. The default values should be removed. Test Plan: 1) Apply this patch 2) prove t/db_dependent/Koha/Biblio.t 3) prove t/db_dependent/Koha/Recalls.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=33053 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149075|0 |1 is obsolete| | --- Comment #3 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 150355 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150355&action=edit Bug 33053: Remove default value for tables item_groups and recalls These default biblio_ids of 0 are harmless but incorrect. The default values should be removed. Test Plan: 1) Apply this patch 2) prove t/db_dependent/Koha/Biblio.t 3) prove t/db_dependent/Koha/Recalls.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 --- Comment #4 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 150356 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150356&action=edit Bug 33053: (QA follow-up) fix syntax error Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |aleisha@catalyst.net.nz |y.org | CC| |aleisha@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=33053 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Keywords| |additional_work_needed --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patchset highlighted an issue, see: I commented like this: $ git diff diff --git a/t/db_dependent/api/v1/item_groups.t b/t/db_dependent/api/v1/item_groups.t index 3506eae582d..8a823d121ec 100755 --- a/t/db_dependent/api/v1/item_groups.t +++ b/t/db_dependent/api/v1/item_groups.t @@ -112,11 +112,11 @@ subtest 'add() tests' => sub { # Invalid biblio id { # hide useless warnings - local *STDERR; - open STDERR, '>', '/dev/null'; + #local *STDERR; + #open STDERR, '>', '/dev/null'; $t->post_ok( "//$auth_userid:$password@/api/v1/biblios/XXX/item_groups" => json => $item_group ) ->status_is( 404 ); - close STDERR; + #close STDERR; } $schema->storage->txn_rollback; And then: $ prove t/db_dependent/api/v1/item_groups.t t/db_dependent/api/v1/item_groups.t .. 1/5 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblio_id' cannot be null at /kohadevbox/koha/Koha/Object.pm line 170 # Failed test '404 Not Found' # at t/db_dependent/api/v1/item_groups.t line 117. # got: '500' # expected: '404' # Looks like you failed 1 test of 6. # Failed test 'add() tests' # at t/db_dependent/api/v1/item_groups.t line 123. Please provide a fix! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 151094 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151094&action=edit Bug 33053: Handle invalid biblio_id more robustly This patch addresses the fact the invalid FK error might differ under some circumstances. We could try to catch the exception adding another case, but I think this pattern is cleaner and the authors didn't provide a fix. We can discuss it later, as this controller class has several things to review. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.06 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Many hands makes light work, thankyou everyone! Pushed to 22.11.x for the next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33053 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED CC| |lucas@bywatersolutions.com --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- Patchset won't apply cleanly to 22.05.x, no backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org