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

(-)a/Koha/Schema/Result/Deletedbiblio.pm (-1 / +6 lines)
Lines 184-189 __PACKAGE__->has_many( Link Here
184
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-08-05 13:53:34
184
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-08-05 13:53:34
185
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FQaznWmkfR2Ge5NG8lDmSw
185
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FQaznWmkfR2Ge5NG8lDmSw
186
186
187
sub koha_objects_class {
188
    'Koha::Old::Biblios';
189
}
190
sub koha_object_class {
191
    'Koha::Old::Biblio';
192
}
187
193
188
# You can replace this text with custom content, and it will be preserved on regeneration
189
1;
194
1;
(-)a/Koha/Schema/Result/Deletedbiblioitem.pm (-1 / +6 lines)
Lines 291-296 __PACKAGE__->set_primary_key("biblioitemnumber"); Link Here
291
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
291
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
292
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QLYBa1Ea8Jau2Wy6U+wyQw
292
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QLYBa1Ea8Jau2Wy6U+wyQw
293
293
294
sub koha_objects_class {
295
    'Koha::Old::Biblioitems';
296
}
297
sub koha_object_class {
298
    'Koha::Old::Biblioitem';
299
}
294
300
295
# You can replace this text with custom content, and it will be preserved on regeneration
296
1;
301
1;
(-)a/Koha/Schema/Result/Deletedborrower.pm (-1 / +6 lines)
Lines 653-658 __PACKAGE__->add_columns( Link Here
653
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-22 04:33:29
653
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-22 04:33:29
654
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zK1jC6Wawwj8B2ch9KFByw
654
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zK1jC6Wawwj8B2ch9KFByw
655
655
656
sub koha_objects_class {
657
    'Koha::Old::Patrons';
658
}
659
sub koha_object_class {
660
    'Koha::Old::Patron';
661
}
656
662
657
# You can replace this text with custom code or comments, and it will be preserved on regeneration
658
1;
663
1;
(-)a/Koha/Schema/Result/Deleteditem.pm (-1 / +6 lines)
Lines 410-415 __PACKAGE__->set_primary_key("itemnumber"); Link Here
410
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-26 16:15:09
410
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-26 16:15:09
411
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L7G0HG5gvgyhfpKb7LcUFw
411
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L7G0HG5gvgyhfpKb7LcUFw
412
412
413
sub koha_objects_class {
414
    'Koha::Old::Items';
415
}
416
sub koha_object_class {
417
    'Koha::Old::Item';
418
}
413
419
414
# You can replace this text with custom content, and it will be preserved on regeneration
415
1;
420
1;
(-)a/t/db_dependent/TestBuilder.t (-2 / +4 lines)
Lines 395-402 subtest 'build_object() tests' => sub { Link Here
395
            eval "require $module";
395
            eval "require $module";
396
            my $object = $builder->build_object( { class => $module } );
396
            my $object = $builder->build_object( { class => $module } );
397
            is( ref($object), $module->object_class, "Testing $module" );
397
            is( ref($object), $module->object_class, "Testing $module" );
398
            eval {$object->get_from_storage};
398
            if ( $module ne 'Koha::Old::Patrons' ) { # FIXME deletedborrowers does not have a PK
399
            is( $@, '', "Module $module should have koha_object[s]_class method if needed" );
399
                eval {$object->get_from_storage};
400
                is( $@, '', "Module $module should have koha_object[s]_class method if needed" );
401
            }
400
402
401
            # Testing koha_object_class and koha_objects_class
403
            # Testing koha_object_class and koha_objects_class
402
            my $object_class =  Koha::Object::_get_object_class($object->_result->result_class);
404
            my $object_class =  Koha::Object::_get_object_class($object->_result->result_class);
(-)a/t/lib/TestBuilder.pm (-7 / +10 lines)
Lines 81-97 sub build_object { Link Here
81
81
82
    load $class;
82
    load $class;
83
    my $source = $class->_type;
83
    my $source = $class->_type;
84
    my @pks = $self->schema->source( $class->_type )->primary_columns;
85
84
86
    my $hashref = $self->build({ source => $source, value => $value });
85
    my $hashref = $self->build({ source => $source, value => $value });
87
    my @ids;
86
    my $object;
87
    if ( $class eq 'Koha::Old::Patrons' ) {
88
        $object = $class->search({ borrowernumber => $hashref->{borrowernumber} })->next;
89
    } else {
90
        my @ids;
91
        my @pks = $self->schema->source( $class->_type )->primary_columns;
92
        foreach my $pk ( @pks ) {
93
            push @ids, $hashref->{ $pk };
94
        }
88
95
89
    foreach my $pk ( @pks ) {
96
        $object = $class->find( @ids );
90
        push @ids, $hashref->{ $pk };
91
    }
97
    }
92
98
93
    my $object = $class->find( @ids );
94
95
    return $object;
99
    return $object;
96
}
100
}
97
101
98
- 

Return to bug 24150