Bug 28056 - Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Summary: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 27858
Blocks: 27857
  Show dependency treegraph
 
Reported: 2021-03-30 13:50 UTC by Tomás Cohen Arazi
Modified: 2021-04-19 10:15 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
This patch adds a new exception for more fine-grained control on the errors when dealing with patrons and their extended attributes.
Version(s) released in:
21.05.00


Attachments
Bug 28056: Unit tests (1.57 KB, patch)
2021-03-30 13:54 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute (2.35 KB, patch)
2021-03-30 13:54 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28056: Unit tests (1.63 KB, patch)
2021-03-31 14:06 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute (2.42 KB, patch)
2021-03-31 14:06 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28056: Unit tests (1.69 KB, patch)
2021-04-01 11:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute (2.48 KB, patch)
2021-04-01 11:52 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2021-03-30 13:50:12 UTC
We need such exception to use it in Koha::Patron->extended_attributes. Right now we use the generic FKContraint one, that makes it hard to tell the caller what the problem is (as this is also a valid exception when adding a patron with an invalid (say) categorycode.
Comment 1 Tomás Cohen Arazi 2021-03-30 13:54:22 UTC
Created attachment 119007 [details] [review]
Bug 28056: Unit tests
Comment 2 Tomás Cohen Arazi 2021-03-30 13:54:25 UTC
Created attachment 119008 [details] [review]
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute

This trivial patch adds a new exception for more fine-grained control on
the errors when dealing with patrons and their extended attributes.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/Koha/Exceptions.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Comment 3 David Nind 2021-03-31 09:19:46 UTC
Patch doesn't apply 8-(...

Applying: Bug 28056: Unit tests
error: sha1 information is lacking or useless (t/Koha/Exceptions.t).
error: could not build fake ancestor
Patch failed at 0001 Bug 28056: Unit tests
Comment 4 Tomás Cohen Arazi 2021-03-31 11:18:56 UTC
(In reply to David Nind from comment #3)
> Patch doesn't apply 8-(...
> 
> Applying: Bug 28056: Unit tests
> error: sha1 information is lacking or useless (t/Koha/Exceptions.t).
> error: could not build fake ancestor
> Patch failed at 0001 Bug 28056: Unit tests

Yeah, the dependencies were messed up. Sorry for that!
Comment 5 Martin Renvoize 2021-03-31 14:06:56 UTC
Created attachment 119051 [details] [review]
Bug 28056: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2021-03-31 14:06:59 UTC
Created attachment 119052 [details] [review]
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute

This trivial patch adds a new exception for more fine-grained control on
the errors when dealing with patrons and their extended attributes.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/Koha/Exceptions.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2021-03-31 14:08:36 UTC
All works as expected, thanks Tomas
Comment 8 Nick Clemens 2021-04-01 11:52:21 UTC
Created attachment 119072 [details] [review]
Bug 28056: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens 2021-04-01 11:52:24 UTC
Created attachment 119073 [details] [review]
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute

This trivial patch adds a new exception for more fine-grained control on
the errors when dealing with patrons and their extended attributes.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/Koha/Exceptions.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Jonathan Druart 2021-04-09 14:41:18 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 11 Fridolin Somers 2021-04-19 10:15:09 UTC
Enhancement not pushed to 20.11.x