[Koha-bugs] [Bug 17828] Koha::Patron::Attribute-> store should raise an exception if unique_id is being broken

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 23 09:38:32 CET 2017


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

Josef Moravec <josef.moravec at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #58558|0                           |1
        is obsolete|                            |

--- Comment #7 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 61506
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61506&action=edit
[SIGNED-OFF] Bug 17828: Overload Koha::Patron::Attribute->store to check for
unique_id and repeatable

This patch introduces a Koha::Patron::Attribute->store method that does
the required check for the corresponding Koha::Patron::Attribute::Type
and raises an exception if trying to store more than one unique
attribute code/value combination, and another exception for
non-repeatable attribute types being stored while already existing on
the DB.

This patch introduces exception definitions for that purpose.

To test:
- Apply the unit tests patches
- Run:
  $ prove t/db_dependent/Koha/Patron/Attributes.t
=> FAIL: Tests fail
- Apply this patch
- Run:
  $ prove t/db_dependent/Koha/Patron/Attributes.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec at gmail.com>

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


More information about the Koha-bugs mailing list