[Koha-bugs] [Bug 18501] Automatic refunds need protection from failure

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Aug 18 13:35:02 CEST 2020


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

--- Comment #43 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Comment on attachment 108301
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108301
Bug 18501: (QA follow-up) Fix regressions highlighted by unit tests

Review of attachment 108301:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=18501&attachment=108301)
-----------------------------------------------------------------

::: Koha/Item.pm
@@ -124,5 @@
> -          # Why not for AddItem as well?
> -            my @fields = qw( itemlost withdrawn damaged );
> -
> -            # Only retrieve the item if we need to set an "on" date field
> -            if ( $self->itemlost || $self->withdrawn || $self->damaged ) {

SO.. if any of these fields is 'true' (already in the DB or having been updated
to true)...

@@ -128,5 @@
> -            if ( $self->itemlost || $self->withdrawn || $self->damaged ) {
> -                my $pre_mod_item = $self->get_from_storage;
> -                for my $field (@fields) {
> -                    if (    $self->$field
> -                        and not $pre_mod_item->$field )

Check if it is true now but wasn't true before.. and update '*_on' field..

If it was true before and is still true (changed or otherwise) then this will
not trigger..

@@ +146,5 @@
> +            }
> +            # If the field has changed otherwise, we much update
> +            # the 'on' field
> +            elsif ( exists $updated_columns{$field}
> +                && $updated_columns{$field} ne $pre_mod_item->$field )

SO.. I need to change 'ne' to `&& !`

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


More information about the Koha-bugs mailing list