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

(-)a/C4/Biblio.pm (+1 lines)
Lines 556-561 sub LinkBibHeadingsToAuthorities { Link Here
556
    }
556
    }
557
    require C4::Heading;
557
    require C4::Heading;
558
    require C4::AuthoritiesMarc;
558
    require C4::AuthoritiesMarc;
559
559
    $allowrelink = 1 unless defined $allowrelink;
560
    $allowrelink = 1 unless defined $allowrelink;
560
    my $num_headings_changed = 0;
561
    my $num_headings_changed = 0;
561
    foreach my $field ( $bib->fields() ) {
562
    foreach my $field ( $bib->fields() ) {
(-)a/svc/cataloguing/automatic_linker.pl (-10 / +10 lines)
Lines 4-21 Link Here
4
#
4
#
5
# This file is part of Koha.
5
# This file is part of Koha.
6
#
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
7
# Koha is free software; you can redistribute it and/or modify it
8
# terms of the GNU General Public License as published by the Free Software
8
# under the terms of the GNU General Public License as published by
9
# Foundation; either version 3 of the License, or (at your option) any later
9
# the Free Software Foundation; either version 3 of the License, or
10
# version.
10
# (at your option) any later version.
11
#
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12
# Koha is distributed in the hope that it will be useful, but
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
15
#
16
#
16
# You should have received a copy of the GNU General Public License along
17
# You should have received a copy of the GNU General Public License
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use CGI;
21
use CGI;
(-)a/t/Biblio.t (-1 lines)
Lines 157-160 warnings_like { $ret = UpdateTotalIssues() } Link Here
157
    "UpdateTotalIssues returns carped warnings if biblio record does not exist";
157
    "UpdateTotalIssues returns carped warnings if biblio record does not exist";
158
158
159
ok( !defined $ret, 'UpdateTotalIssues returns carped warning if biblio record does not exist');
159
ok( !defined $ret, 'UpdateTotalIssues returns carped warning if biblio record does not exist');
160
1;
(-)a/t/db_dependent/Biblio.t (-5 / +4 lines)
Lines 767-779 subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { Link Here
767
    );
767
    );
768
768
769
    #Add test for this case using verbose
769
    #Add test for this case using verbose
770
    my ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
770
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
771
    my $details = $results->{details};
771
    my $details = $results->{details};
772
    is( $num_headings_changed, 1, 'We changed the one we passed' );
772
    is( $num_headings_changed, 1, 'We changed the one we passed' );
773
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
773
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
774
774
775
    # Now we check the authority record itself
775
    # Now we check the authority record itself
776
    my $authority = GetAuthority($results->{details}->[0]->{authid});
776
    $authority = GetAuthority($results->{details}->[0]->{authid});
777
777
778
    is( $authority->field('150')->as_string(),
778
    is( $authority->field('150')->as_string(),
779
         "Beach city Weirdness Fiction Books 21st Century Fish Stew Pizza",
779
         "Beach city Weirdness Fiction Books 21st Century Fish Stew Pizza",
Lines 800-812 subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { Link Here
800
        "The generated record contains the correct subfields"
800
        "The generated record contains the correct subfields"
801
    );
801
    );
802
802
803
    # The same exemple With verbose
803
    # The same example With verbose
804
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
804
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
805
    is( $num_headings_changed, 1, 'We changed the one we passed' );
805
    is( $num_headings_changed, 1, 'We changed the one we passed' );
806
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
806
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
807
807
808
    # Now we check the authority record itself
808
    # Now we check the authority record itself
809
    my $authority = GetAuthority($results->{details}->[0]->{authid});
809
    $authority = GetAuthority($results->{details}->[0]->{authid});
810
    is( $authority->field('100')->as_string(),
810
    is( $authority->field('100')->as_string(),
811
         "Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings",
811
         "Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings",
812
         "The generated record contains the correct subfields"
812
         "The generated record contains the correct subfields"
813
- 

Return to bug 11299