[Bug 27833] New: Koha::Exceptions::Patron::Attribute::* should have parameters
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Bug ID: 27833 Summary: Koha::Exceptions::Patron::Attribute::* should have parameters Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement 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 When one of them is thrown, they should carry the failing code and value. This way we can provide better feedback on the UI (or the API). -- 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=27833 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Depends on| |17828 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17828 [Bug 17828] Koha::Patron::Attribute->store should raise an exception if unique_id is being broken -- 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=27833 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 117516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117516&action=edit Bug 27833: Make Koha::Exceptions::Patron::Attribute::* have parameters This patch adds a 'field' to this exceptions. They now have an 'attribute' parameter referencing the object itself, To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! 3. Sign off! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 117517 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117517&action=edit Bug 27833: Add unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 117518 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117518&action=edit Bug 27833: Make K::P::Attribute add the object to the exception This patch makes the 'check_unique_id' and '_check_repeatable' methods pass the 'attribute' parameter when throwing an exception. This way we can provid emore meaningfull error messages. To test: 1. Apply the previous patches 2. Run $ kshell k$ prove t/db_dependent/Koha/Patron/Attributes.t => FAIL: The exceptions are not passed the attribute! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23666 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23666 [Bug 23666] Add API route for additional patron attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 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=27833 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117516|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 117546 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117546&action=edit Bug 27833: Make Koha::Exceptions::Patron::Attribute::* have parameters This patch adds a 'field' to this exceptions. They now have an 'attribute' parameter referencing the object itself, To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! 3. Sign off! 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=27833 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117517|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 117547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117547&action=edit Bug 27833: Add unit tests 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=27833 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117518|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 117548 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117548&action=edit Bug 27833: Make K::P::Attribute add the object to the exception This patch makes the 'check_unique_id' and '_check_repeatable' methods pass the 'attribute' parameter when throwing an exception. This way we can provid emore meaningfull error messages. To test: 1. Apply the previous patches 2. Run $ kshell k$ prove t/db_dependent/Koha/Patron/Attributes.t => FAIL: The exceptions are not passed the attribute! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D 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=27833 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27857 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27857 [Bug 27857] Koha::Patron->extended_attributes skips checks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 117676 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117676&action=edit Bug 27833: (follow-up) Add InvalidType exception Working on bug 27857 showed we needed one more exception, for when the passed attribute type is invalid. This patch adds the Koha::Exceptions::Patron::Attribute::InvalidType exception. It adds a format for stringifying it, and tests are added. The previous exceptions tests lacked one case, so I add them on this patch as well. To test: 1. Apply this patch 2. Run: $ kshell k$ prove tt/Koha/Exceptions.t => SUCCESS: Tests pass! 3. 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=27833 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27858 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27858 [Bug 27858] Make Koha::Patron::Attribute->store raise an exception on invalid type/code -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117546|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117701 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117701&action=edit Bug 27833: Make Koha::Exceptions::Patron::Attribute::* have parameters This patch adds a 'field' to this exceptions. They now have an 'attribute' parameter referencing the object itself, To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/Koha/Exceptions.t => SUCCESS: Tests pass! 3. Sign off! Signed-off-by: David Nind <david@davidnind.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=27833 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117547|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117702&action=edit Bug 27833: Add unit tests Signed-off-by: David Nind <david@davidnind.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=27833 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117548|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117703 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117703&action=edit Bug 27833: Make K::P::Attribute add the object to the exception This patch makes the 'check_unique_id' and '_check_repeatable' methods pass the 'attribute' parameter when throwing an exception. This way we can provid emore meaningfull error messages. To test: 1. Apply the previous patches 2. Run $ kshell k$ prove t/db_dependent/Koha/Patron/Attributes.t => FAIL: The exceptions are not passed the attribute! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.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=27833 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117676|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117704&action=edit Bug 27833: (follow-up) Add InvalidType exception Working on bug 27857 showed we needed one more exception, for when the passed attribute type is invalid. This patch adds the Koha::Exceptions::Patron::Attribute::InvalidType exception. It adds a format for stringifying it, and tests are added. The previous exceptions tests lacked one case, so I add them on this patch as well. To test: 1. Apply this patch 2. Run: $ kshell k$ prove tt/Koha/Exceptions.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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=27833 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Good call, I've recently done similar for a few other exceptions. Code reads well, is tested and works as expected. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|27857 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27857 [Bug 27857] Koha::Patron->extended_attributes skips checks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|23666 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23666 [Bug 23666] Add API route for additional patron attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Tomás Cohen Arazi <tomascohen@gmail.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=27833 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This development adds release notes| |parameters to the extended | |attributes-related | |exceptions. This allows | |better handling. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Enhancement not pushed to 20.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27833 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28220 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28220 [Bug 28220] Exception not caught when importing patrons -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org