[Bug 38342] New: Koha::Object->store warning on invalid ENUM value
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 Bug ID: 38342 Summary: Koha::Object->store warning on invalid ENUM value Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Bug 38175 introduced handling for truncated enum values. But the exception that is thrown is missing a parameter, and as such prints a warning when stringifying the exception. To test: 1. On KTD, run: $ ktd --shell k$ prove t/db_dependent/Koha/Booking.t => FAIL: There's: ``` DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'status' at row 1 at /kohadevbox/koha/Koha/Object.pm line 172 Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/Exceptions/Object.pm line 84. Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/Exceptions/Object.pm line 84. ok 1 - Throws exception when passed booking status would fail enum constraint ``` The 'Use of initialized...' ones are not correct. -- 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=38342 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com CC| |tomascohen@gmail.com Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.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=38342 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |38175 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38175 [Bug 38175] Improve bookings behavior with new status field -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 173919 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173919&action=edit Bug 38342: Pass the value to exception to avoid warnings This patch makes the exception on bad enum values in Koha::Object->store not print a warning in the event of stringifying the exception. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Booking.t => FAIL: You get this warnings: ``` Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/Exceptions/Object.pm line 84. ``` 2. Apply this patch 3. Repeat 1 => SUCCESS: No more uninitialized values warnings 4. Sign off :-D 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=38342 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- @ashimema: I have doubts about the handling you added for the 'property' value. Specifically: ``` property => $property =~ /(\w+\.\w+)$/ ? $1 : $property, # results in table.column without quotes or backtics ``` Before that check you added for cleaning it up, there's a use of `$property` as-is for checking the column is of type ENUM. So I feel either my patch is correct, or we might miss some cases for enum types (i.e. the cleanup needs to happen for all uses of `$property`, not just the last one). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173919|0 |1 is obsolete| | --- Comment #3 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 173978 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173978&action=edit Bug 38342: Pass the value to exception to avoid warnings This patch makes the exception on bad enum values in Koha::Object->store not print a warning in the event of stringifying the exception. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Booking.t => FAIL: You get this warnings: ``` Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/Exceptions/Object.pm line 84. ``` 2. Apply this patch 3. Repeat 1 => SUCCESS: No more uninitialized values warnings 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de 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=38342 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #173978|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 174089 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174089&action=edit Bug 38342: Pass the value to exception to avoid warnings This patch makes the exception on bad enum values in Koha::Object->store not print a warning in the event of stringifying the exception. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Booking.t => FAIL: You get this warnings: ``` Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/Exceptions/Object.pm line 84. ``` 2. Apply this patch 3. Repeat 1 => SUCCESS: No more uninitialized values warnings 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> 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=38342 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> 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=38342 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Should we have a unit test here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38342 Bug 38342 depends on bug 38175, which changed state. Bug 38175 Summary: Improve bookings behavior with new status field https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38175 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org