[Koha-bugs] [Bug 32528] Koha::Item->safe_to_delete should short-circuit earlier

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 26 19:46:21 CET 2022


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

--- Comment #2 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 144842
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144842&action=edit
Bug 32528: Mkae safe_to_delete exit earlier on error conditions

This patch makes the `Koha::Item->safe_to_delete` method return right
after one of the checked conditions is met. This way we avoid further DB
queries and processing.

No behavior change is expected

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests STILL pass!
4. 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