[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 Mar 26 15:32:37 CET 2021


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

--- Comment #11 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 118861
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118861&action=edit
Bug 28031: (follow-up) Retrieve type only once

The current implementation of store+check_repeatable+check_unique_id
notably retrieves the related Koha::Patron::Attribute::Type object three
times.

This can be easily solved by retrieving it once and reusing. This patch
does that.

This changes the signature for the helper methods.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patron/Attribute.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Verify the old _check_repeatable method is not used anywhere
   $ git grep _check_repeatable
=> SUCCESS: It is not!
5. Verify check_unique_id is not used anywhere, so no risk changing the
   signature
   $ git grep check_unique_id
=> SUCCESS: It is safe to update it!
6. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

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


More information about the Koha-bugs mailing list