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

(-)a/Koha/Biblio.pm (+14 lines)
Lines 1588-1593 sub normalized_upc { Link Here
1588
    return $self->metadata_extractor->get_normalized_upc;
1588
    return $self->metadata_extractor->get_normalized_upc;
1589
}
1589
}
1590
1590
1591
=head3 opac_suppressed
1592
1593
    my $opac_suppressed = $biblio->opac_suppressed();
1594
1595
Returns whether the record is flagged as suppressed in the OPAC.
1596
FIXME: Revisit after 38330 discussion
1597
1598
=cut
1599
1600
sub opac_suppressed {
1601
    my ($self) = @_;
1602
    return $self->metadata_extractor->get_opac_suppression();
1603
}
1604
1591
=head3 normalized_oclc
1605
=head3 normalized_oclc
1592
1606
1593
    my $normalized_oclc = $biblio->normalized_oclc
1607
    my $normalized_oclc = $biblio->normalized_oclc
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +39 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 37;
20
use Test::More tests => 38;
21
use Test::Exception;
21
use Test::Exception;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 1613-1618 subtest 'normalized_oclc' => sub { Link Here
1613
    );
1613
    );
1614
};
1614
};
1615
1615
1616
subtest 'opac_suppressed() tests' => sub {
1617
1618
    plan tests => 4;
1619
1620
    $schema->storage->txn_begin;
1621
1622
    my $record = MARC::Record->new;
1623
    $record->append_fields(
1624
        MARC::Field->new( '245', '', '', a => 'Some title 1' ),
1625
        MARC::Field->new( '942', '', '', n => '1' ),
1626
    );
1627
1628
    my ($biblio_id) = AddBiblio( $record, qw{} );
1629
    my $biblio = Koha::Biblios->find($biblio_id);
1630
1631
    ok( $biblio->opac_suppressed(), 'Record is suppressed' );
1632
1633
    $record->field('942')->replace_with( MARC::Field->new( '942', '', '', n => '0' ) );
1634
    ($biblio_id) = AddBiblio( $record, qw{} );
1635
    $biblio = Koha::Biblios->find($biblio_id);
1636
1637
    ok( !$biblio->opac_suppressed(), 'Record is not suppressed' );
1638
1639
    $record->field('942')->replace_with( MARC::Field->new( '942', '', '', n => '' ) );
1640
    ($biblio_id) = AddBiblio( $record, qw{} );
1641
    $biblio = Koha::Biblios->find($biblio_id);
1642
1643
    ok( !$biblio->opac_suppressed(), 'Record is not suppressed' );
1644
1645
    $record->delete_field( $record->field('942') );
1646
    ($biblio_id) = AddBiblio( $record, qw{} );
1647
    $biblio = Koha::Biblios->find($biblio_id);
1648
1649
    ok( !$biblio->opac_suppressed(), 'Record is not suppressed' );
1650
1651
    $schema->storage->txn_rollback;
1652
};
1653
1616
subtest 'ratings' => sub {
1654
subtest 'ratings' => sub {
1617
    plan tests => 1;
1655
    plan tests => 1;
1618
    # See t/db_dependent/Koha/Ratings.t
1656
    # See t/db_dependent/Koha/Ratings.t
1619
- 

Return to bug 28478