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.
Created attachment 119007 [details] [review] Bug 28056: Unit tests
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
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
(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!
Created attachment 119051 [details] [review] Bug 28056: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
All works as expected, thanks Tomas
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>
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>
Pushed to master for 21.05, thanks to everybody involved!
Enhancement not pushed to 20.11.x