View | Details | Raw Unified | Return to bug 23185
Collapse All | Expand All

(-)a/Koha/Objects.pm (-4 / +4 lines)
Lines 199-207 sub delete { Link Here
199
=cut
199
=cut
200
200
201
sub update {
201
sub update {
202
    my ($self, $params) = @_;
202
    my ($self, $fields, $options) = @_;
203
203
204
    my $no_triggers = delete $params->{no_triggers};
204
    my $no_triggers = $options->{no_triggers};
205
205
206
    if (
206
    if (
207
        !$no_triggers
207
        !$no_triggers
Lines 212-225 sub update { Link Here
212
        my $objects_updated;
212
        my $objects_updated;
213
        $self->_resultset->result_source->schema->txn_do( sub {
213
        $self->_resultset->result_source->schema->txn_do( sub {
214
            while ( my $o = $self->next ) {
214
            while ( my $o = $self->next ) {
215
                $o->update($params);
215
                $o->update($fields);
216
                $objects_updated++;
216
                $objects_updated++;
217
            }
217
            }
218
        });
218
        });
219
        return $objects_updated;
219
        return $objects_updated;
220
    }
220
    }
221
221
222
    return $self->_resultset->update($params);
222
    return $self->_resultset->update($fields);
223
}
223
}
224
224
225
=head3 single
225
=head3 single
(-)a/t/db_dependent/Koha/Objects.t (-2 / +1 lines)
Lines 995-1001 subtest 'Return same values as DBIx::Class' => sub { Link Here
995
                $patrons_us->update({ surname => 'foo' }); # Koha::Patron->store is supposed to uppercase the surnames
995
                $patrons_us->update({ surname => 'foo' }); # Koha::Patron->store is supposed to uppercase the surnames
996
                is( $patrons_us->search({ surname => 'FOO' })->count, 2, 'Koha::Patron->store is hit' );
996
                is( $patrons_us->search({ surname => 'FOO' })->count, 2, 'Koha::Patron->store is hit' );
997
997
998
                $patrons_us->update({ surname => 'foo', no_triggers => 1 }); # The surnames won't be uppercase as we won't hit Koha::Patron->store
998
                $patrons_us->update({ surname => 'foo' }, { no_triggers => 1 }); # The surnames won't be uppercase as we won't hit Koha::Patron->store
999
                is( $patrons_us->search({ surname => 'foo' })->count, 2, 'Koha::Patron->store is not hit');
999
                is( $patrons_us->search({ surname => 'foo' })->count, 2, 'Koha::Patron->store is not hit');
1000
1000
1001
            };
1001
            };
1002
- 

Return to bug 23185