[Koha-bugs] [Bug 29765] Make Koha::Patron->safe_to_delete return a Koha::Result::Boolean object

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 4 16:20:51 CET 2022


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

Jonathan Druart <jonathan.druart+koha at gmail.com> changed:

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

--- Comment #8 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Created attachment 128999
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128999&action=edit
Bug 29765: Make Koha::Patron->safe_to_delete use Koha::Result::Boolean

This patch makes the safe_to_delete method in Koha::Patron return this
new object type instead of a plain string. This way we have a consistent
way to deal with 'can_*'-like methods return values when feedback is
needed.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patron.t
=> SUCCESS: The adjusted tests pass. Tests cover the boolean context
eval and also the carried messages, that include the same string code
that was returned originally.
3. Sign off :-D

Signed-off-by: David Nind <david at davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

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


More information about the Koha-bugs mailing list