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

--- Comment #43 from Kyle M Hall <[email protected]> ---
I have fixed everything except:

--
@@ +42,5 @@
> +
> +sub debit {
> +    my ( $self ) = @_;
> +    my $debit_rs = $self->_result->debit;
> +    return unless $debit_rs;

I do not think we should "return unless" here, we do not do that for other
methods. Is there a good reason?
--

which I believe to be incorrect. Please refer to Koha::Item::checkout for
precedence. What you write makes sense *if* the foreign key *must* exist ( such
as the case of items.biblionumber ). However, in this case, a checkout may not
exist for this item ). Without that line, you would return a perfectly value
but empty Koha::Checkout object. In that case code such as "if ( my $c =
$item->checkout )" would by true instead of false like everyone would expect it
to be. In fact, $item->checkout would *always* return true since the you'd get
a Koha::Checkout object every time, valid or not.


(In reply to Jonathan Druart from comment #39)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to