[Koha-bugs] [Bug 29457] Fee Cancellation records the wrong manager_id

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Nov 25 10:42:01 CET 2021


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

--- Comment #11 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to Martin Renvoize from comment #2)
> Without the above patch, cancelling a charge in the worst case can lead to a
> database error regarding key constrain failures.. or if your userid's happen
> to coincide with an existing borrowernumber it will record entirely the
> wrong user as the staff member who actioned the cancellation.

It actually won't lead every often to a DBI exception, I've tried to recreate
with userid="koha"/borrowernumber=51, and I saw that "koha" was passed to
->store, but "NULL" was actually in DB.
It's coming from Koha::Object->store:
134         if (   _numeric_column_type( $columns_info->{$col}->{data_type} )
135             or _decimal_column_type( $columns_info->{$col}->{data_type} )
136         ) {
137             # Has been passed but not a number, usually an empty string
138             my $value = $self->_result()->get_column($col);
139             if ( defined $value and not looks_like_number( $value ) ) {
140                 if ( $columns_info->{$col}->{is_nullable} ) {
141                     # If nullable, default to null
142                     $self->_result()->set_column($col => undef);


And that's certainly why we didn't catch that earlier.

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


More information about the Koha-bugs mailing list