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

(-)a/C4/Biblio.pm (-3 / +4 lines)
Lines 554-565 sub DelBiblio { Link Here
554
554
555
    # We delete any existing holds
555
    # We delete any existing holds
556
    my $holds = $biblio->holds;
556
    my $holds = $biblio->holds;
557
    $holds->update({ deleted_biblionumber =>  $biblionumber }, { no_triggers => 1 });
557
    $holds->update( { deleted_biblionumber => $biblionumber }, { no_triggers => 1 } );
558
    my $old_holds = $biblio->old_holds;
558
    my $old_holds = $biblio->old_holds;
559
    $old_holds->update({ deleted_biblionumber =>  $biblionumber }, { no_triggers => 1 });
559
    $old_holds->update( { deleted_biblionumber => $biblionumber }, { no_triggers => 1 } );
560
    while ( my $hold = $holds->next ) {
560
    while ( my $hold = $holds->next ) {
561
561
        # no need to update the holds queue on each step, we'll do it at the end
562
        # no need to update the holds queue on each step, we'll do it at the end
562
        $hold->cancel({ skip_holds_queue => 1 });
563
        $hold->cancel( { skip_holds_queue => 1 } );
563
    }
564
    }
564
565
565
    # We update any existing orders
566
    # We update any existing orders
(-)a/installer/data/mysql/atomicupdate/bug_30648.pl (-3 / +3 lines)
Lines 2-12 use Modern::Perl; Link Here
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
3
4
return {
4
return {
5
    bug_number => "30648",
5
    bug_number  => "30648",
6
    description => "Store biblionumber of deleted record in old reserves",
6
    description => "Store biblionumber of deleted record in old reserves",
7
    up => sub {
7
    up          => sub {
8
        my ($args) = @_;
8
        my ($args) = @_;
9
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
        if ( !column_exists( 'reserves', 'deleted_biblionumber' ) ) {
10
        if ( !column_exists( 'reserves', 'deleted_biblionumber' ) ) {
11
11
12
            $dbh->do(
12
            $dbh->do(
(-)a/t/db_dependent/Biblio.t (-1 / +1 lines)
Lines 697-703 subtest 'DelBiblio' => sub { Link Here
697
            }
697
            }
698
        );
698
        );
699
699
700
        C4::Biblio::DelBiblio($biblio->biblionumber);
700
        C4::Biblio::DelBiblio( $biblio->biblionumber );
701
        $old_hold->discard_changes();
701
        $old_hold->discard_changes();
702
        $hold = Koha::Old::Holds->find( $hold->reserve_id );
702
        $hold = Koha::Old::Holds->find( $hold->reserve_id );
703
        ok( $hold, "Hold has been successfully cancelled on deletion of biblio" );
703
        ok( $hold, "Hold has been successfully cancelled on deletion of biblio" );
(-)a/t/lib/TestBuilder.pm (-5 / +4 lines)
Lines 628-640 sub _gen_default_values { Link Here
628
            opacusercss     => q{},
628
            opacusercss     => q{},
629
        },
629
        },
630
        Reserve => {
630
        Reserve => {
631
            non_priority  => 0,
631
            non_priority         => 0,
632
            item_group_id => undef,
632
            item_group_id        => undef,
633
            deleted_biblionumber => undef,
633
            deleted_biblionumber => undef,
634
        },
634
        },
635
        OldReserve => {
635
        OldReserve => {
636
            non_priority  => 0,
636
            non_priority         => 0,
637
            item_group_id => undef,
637
            item_group_id        => undef,
638
            deleted_biblionumber => undef,
638
            deleted_biblionumber => undef,
639
        },
639
        },
640
        Itemtype => {
640
        Itemtype => {
641
- 

Return to bug 30648