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

(-)a/C4/Biblio.pm (+1 lines)
Lines 492-497 sub LinkBibHeadingsToAuthorities { Link Here
492
    }
492
    }
493
    require C4::Heading;
493
    require C4::Heading;
494
    require C4::AuthoritiesMarc;
494
    require C4::AuthoritiesMarc;
495
495
    $allowrelink = 1 unless defined $allowrelink;
496
    $allowrelink = 1 unless defined $allowrelink;
496
    my $num_headings_changed = 0;
497
    my $num_headings_changed = 0;
497
    foreach my $field ( $bib->fields() ) {
498
    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 740-752 subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { Link Here
740
    );
740
    );
741
741
742
    #Add test for this case using verbose
742
    #Add test for this case using verbose
743
    my ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
743
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
744
    my $details = $results->{details};
744
    my $details = $results->{details};
745
    is( $num_headings_changed, 1, 'We changed the one we passed' );
745
    is( $num_headings_changed, 1, 'We changed the one we passed' );
746
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
746
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
747
747
748
    # Now we check the authority record itself
748
    # Now we check the authority record itself
749
    my $authority = GetAuthority($results->{details}->[0]->{authid});
749
    $authority = GetAuthority($results->{details}->[0]->{authid});
750
750
751
    is( $authority->field('150')->as_string(),
751
    is( $authority->field('150')->as_string(),
752
         "Beach city Weirdness Fiction Books 21st Century Fish Stew Pizza",
752
         "Beach city Weirdness Fiction Books 21st Century Fish Stew Pizza",
Lines 773-785 subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { Link Here
773
        "The generated record contains the correct subfields"
773
        "The generated record contains the correct subfields"
774
    );
774
    );
775
775
776
    # The same exemple With verbose
776
    # The same example With verbose
777
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
777
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef, 1);
778
    is( $num_headings_changed, 1, 'We changed the one we passed' );
778
    is( $num_headings_changed, 1, 'We changed the one we passed' );
779
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
779
    is( $results->{details}->[0]->{status}, 'CREATED', "We added an authority record for the heading using verbose");
780
780
781
    # Now we check the authority record itself
781
    # Now we check the authority record itself
782
    my $authority = GetAuthority($results->{details}->[0]->{authid});
782
    $authority = GetAuthority($results->{details}->[0]->{authid});
783
    is( $authority->field('100')->as_string(),
783
    is( $authority->field('100')->as_string(),
784
         "Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings",
784
         "Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings",
785
         "The generated record contains the correct subfields"
785
         "The generated record contains the correct subfields"
786
- 

Return to bug 11299