[Koha-bugs] [Bug 27858] Make Koha::Patron::Attribute->store raise an exception on invalid type/code

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 22 15:00:13 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27858

--- Comment #14 from Joonas Kylmälä <joonas.kylmala at helsinki.fi> ---
Created attachment 118599
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118599&action=edit
Bug 27858: Make Koha::Patron::Attribute->store raise an exception on invalid
type/code

This patch adds type validation to the ->store method. And exception
should be thrown if the type is invalid. Things currently explode in
such situations, so this doesn't change the behavior (just adding more
informative failure information).

To test:
1. Apply the previous patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patron/Attribute.t
=> FAIL: No exception is thrown on the bad case, weird error
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! Exception thrown!
5. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala at helsinki.fi>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list