Bug 28056

Summary: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, fridolin.somers, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
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
Circulation function:
Bug Depends on: 27858    
Bug Blocks: 27857    
Attachments: Bug 28056: Unit tests
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Bug 28056: Unit tests
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
Bug 28056: Unit tests
Bug 28056: Add Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute

Description Tomás Cohen Arazi (tcohen) 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 (tcohen) 2021-03-30 13:54:22 UTC
Created attachment 119007 [details] [review]
Bug 28056: Unit tests
Comment 2 Tomás Cohen Arazi (tcohen) 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 (tcohen) 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 (ashimema) 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 (ashimema) 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 (ashimema) 2021-03-31 14:08:36 UTC
All works as expected, thanks Tomas
Comment 8 Nick Clemens (kidclamp) 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 (kidclamp) 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