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

(-)a/Koha/Biblio.pm (+6 lines)
Lines 2338-2343 sub merge_with { Link Here
2338
                    my $from_biblio = Koha::Biblios->find($bn_merge);
2338
                    my $from_biblio = Koha::Biblios->find($bn_merge);
2339
                    $from_biblio->items->move_to_biblio($self);
2339
                    $from_biblio->items->move_to_biblio($self);
2340
2340
2341
                    # Move item groups
2342
                    $from_biblio->item_groups->update(
2343
                        { biblio_id   => $ref_biblionumber },
2344
                        { no_triggers => 1 }
2345
                    );
2346
2341
                    # Move article requests
2347
                    # Move article requests
2342
                    $from_biblio->article_requests->update(
2348
                    $from_biblio->article_requests->update(
2343
                        { biblionumber => $ref_biblionumber },
2349
                        { biblionumber => $ref_biblionumber },
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +21 lines)
Lines 649-655 subtest 'bookings() tests' => sub { Link Here
649
};
649
};
650
650
651
subtest 'merge of records' => sub {
651
subtest 'merge of records' => sub {
652
    plan tests => 8;
652
    plan tests => 9;
653
653
654
    subtest 'move items' => sub {
654
    subtest 'move items' => sub {
655
        plan tests => 9;
655
        plan tests => 9;
Lines 702-707 subtest 'merge of records' => sub { Link Here
702
        $schema->storage->txn_rollback;
702
        $schema->storage->txn_rollback;
703
    };
703
    };
704
704
705
    subtest 'move item groups' => sub {
706
        plan tests => 3;
707
        $schema->storage->txn_begin;
708
709
        my $biblio1 = $builder->build_sample_biblio;
710
        my $biblio2 = $builder->build_sample_biblio;
711
712
        my $ig1 = $builder->build_object(
713
            { class => 'Koha::Biblio::ItemGroups', value => { biblio_id => $biblio1->biblionumber } } );
714
        my $ig2 = $builder->build_object(
715
            { class => 'Koha::Biblio::ItemGroups', value => { biblio_id => $biblio2->biblionumber } } );
716
717
        warning_like { $biblio1->merge_with( [ $biblio2->biblionumber ] ) } q{};
718
719
        is( $ig1->get_from_storage->biblio_id, $biblio1->biblionumber );
720
        is( $ig2->get_from_storage->biblio_id, $biblio1->biblionumber );
721
722
        $schema->storage->txn_rollback;
723
    };
724
705
    subtest 'move article requests' => sub {
725
    subtest 'move article requests' => sub {
706
        plan tests => 3;
726
        plan tests => 3;
707
        $schema->storage->txn_begin;
727
        $schema->storage->txn_begin;
708
- 

Return to bug 31460