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

(-)a/Koha/Import/Record.pm (+15 lines)
Lines 22-27 use MARC::Record; Link Here
22
22
23
use C4::Context;
23
use C4::Context;
24
use Koha::Database;
24
use Koha::Database;
25
use Koha::Import::Record::Biblios;
25
26
26
use base qw(Koha::Object);
27
use base qw(Koha::Object);
27
28
Lines 56-61 sub get_marc_record { Link Here
56
    return $record;
57
    return $record;
57
}
58
}
58
59
60
=head3 import_biblio
61
62
Returns the import biblio object for this import record
63
64
    my $import_biblio = $import_record->import_biblio()
65
66
=cut
67
68
sub import_biblio {
69
    my ( $self ) = @_;
70
    my $import_biblio_rs = $self->_result->import_biblio;
71
    return Koha::Import::Record::Biblio->_new_from_dbic( $import_biblio_rs );
72
}
73
59
=head2 Internal methods
74
=head2 Internal methods
60
75
61
=head3 _type
76
=head3 _type
(-)a/Koha/Import/Record/Biblio.pm (+44 lines)
Line 0 Link Here
1
package Koha::Import::Record::Biblio;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use base qw(Koha::Object);
25
26
=head1 NAME
27
28
Koha::Import::Record::Biblio - Koha Import Record Biblio Object class
29
30
=head1 API
31
32
=head2 Internal methods
33
34
=head3 _type
35
36
Returns name of corresponding DBIC resultset
37
38
=cut
39
40
sub _type {
41
    return 'ImportBiblio';
42
}
43
44
1;
(-)a/Koha/Import/Record/Biblios.pm (+56 lines)
Line 0 Link Here
1
package Koha::Import::Record::Biblios;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::Import::Record::Biblio;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::Import::Record::Biblios - Koha Import Record Biblios Object set class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub _type {
43
    return 'ImportBiblio';
44
}
45
46
=head3 object_class
47
48
Koha::Object class
49
50
=cut
51
52
sub object_class {
53
    return 'Koha::Import::Record::Biblio';
54
}
55
56
1;
(-)a/installer/data/mysql/atomicupdate/bug_31569.pl (+14 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "31569",
5
    description => "Add primary key for import_biblios",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless( primary_key_exists('import_biblios') ){
10
            $dbh->do(q{ALTER TABLE import_biblios ADD PRIMARY KEY (import_record_id)});
11
            say $out "Added primary key to import_biblios table";
12
        }
13
    },
14
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 3052-3057 CREATE TABLE `import_biblios` ( Link Here
3052
  `isbn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3052
  `isbn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3053
  `issn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3053
  `issn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3054
  `has_items` tinyint(1) NOT NULL DEFAULT 0,
3054
  `has_items` tinyint(1) NOT NULL DEFAULT 0,
3055
  PRIMARY KEY (`import_record_id`),
3055
  KEY `import_biblios_ibfk_1` (`import_record_id`),
3056
  KEY `import_biblios_ibfk_1` (`import_record_id`),
3056
  KEY `matched_biblionumber` (`matched_biblionumber`),
3057
  KEY `matched_biblionumber` (`matched_biblionumber`),
3057
  KEY `title` (`title`(191)),
3058
  KEY `title` (`title`(191)),
3058
- 

Return to bug 31569