Bug 25303: Call ->reset before iterate on the set
In case we already started to iterate. This fixes a failing tests in t/db_dependent/Koha/Biblios.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
049aee2536
commit
c95add2e17
1 changed files with 1 additions and 0 deletions
|
@ -182,6 +182,7 @@ sub delete {
|
|||
if ( Class::Inspector->function_exists( $self->object_class, 'delete' ) ) {
|
||||
my $objects_deleted;
|
||||
$self->_resultset->result_source->schema->txn_do( sub {
|
||||
$self->reset; # If we iterated already over the set
|
||||
while ( my $o = $self->next ) {
|
||||
$o->delete;
|
||||
$objects_deleted++;
|
||||
|
|
Loading…
Reference in a new issue