[Koha-bugs] [Bug 28031] Koha::Patron::Attribute->_check_repeatable doesn't exclude the object's ID

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 9 14:54:59 CEST 2021


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

--- Comment #16 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 119377
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119377&action=edit
Bug 28031: (QA follow-up) Adapt controllers and class

This patch adapts the *memberentry.pl controllers so they pass the $type
parameter when calling unique_ok. The parameter would still be retrieved
from the DB if not passed, and then fetched again for reporting back
errors... So it makes sense to do it once and stick with this approach.

The $type parameter is made mandatory, and exceptions are thrown if
missing. Tests added only for this exception situation, as the other
cases are already covered in the store() tests.

Bonus: this patch also fixes a mistake made on a late follow-up for bug
27857 on the tests.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patron.t \
           t/db_dependent/Koha/Patron/Attribute*
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

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


More information about the Koha-bugs mailing list