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

(-)a/Koha/Biblio.pm (+5 lines)
Lines 24-29 use List::MoreUtils qw(any); Link Here
24
use URI;
24
use URI;
25
use URI::Escape;
25
use URI::Escape;
26
26
27
use C4::Koha;
27
use C4::Biblio qw();
28
use C4::Biblio qw();
28
29
29
use Koha::Database;
30
use Koha::Database;
Lines 675-680 sub custom_cover_image_url { Link Here
675
        my $isbn = $self->biblioitem->isbn;
676
        my $isbn = $self->biblioitem->isbn;
676
        $url =~ s|%isbn%|$isbn|g;
677
        $url =~ s|%isbn%|$isbn|g;
677
    }
678
    }
679
    if ( $url =~ m|%normalized_isbn%| ) {
680
        my $normalized_isbn = C4::Koha::GetNormalizedISBN($self->biblioitem->isbn);
681
        $url =~ s|%normalized_isbn%|$normalized_isbn|g;
682
    }
678
    if ( $url =~ m|%issn%| ) {
683
    if ( $url =~ m|%issn%| ) {
679
        my $issn = $self->biblioitem->issn;
684
        my $issn = $self->biblioitem->issn;
680
        $url =~ s|%issn%|$issn|g;
685
        $url =~ s|%issn%|$issn|g;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (-1 / +1 lines)
Lines 346-352 Enhanced Content: Link Here
346
            - "Using the following URL:"
346
            - "Using the following URL:"
347
            - pref: CustomCoverImagesURL
347
            - pref: CustomCoverImagesURL
348
              class: url
348
              class: url
349
            - "You can defined it using the following patterns: %isbn%, %issn%."
349
            - "You can define it using the following patterns: %isbn%, %issn%, %normalized_isbn%."
350
    HTML5 Media:
350
    HTML5 Media:
351
        -
351
        -
352
            - Show a tab with a HTML5 media player for files catalogued in field 856
352
            - Show a tab with a HTML5 media player for files catalogued in field 856
(-)a/t/db_dependent/Koha/Biblios.t (-3 / +6 lines)
Lines 188-198 subtest 'can_be_transferred' => sub { Link Here
188
};
188
};
189
189
190
subtest 'custom_cover_image_url' => sub {
190
subtest 'custom_cover_image_url' => sub {
191
    plan tests => 2;
191
    plan tests => 3;
192
192
193
    t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%isbn%_%issn%.png' );
193
    t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%isbn%_%issn%.png' );
194
194
195
    my $isbn       = 'my_isbn';
195
    my $isbn       = '0553573403 | 9780553573404 (pbk.).png';
196
    my $issn       = 'my_issn';
196
    my $issn       = 'my_issn';
197
    my $marc_record = MARC::Record->new;
197
    my $marc_record = MARC::Record->new;
198
    my ( $biblionumber, undef ) = C4::Biblio::AddBiblio($marc_record, '');
198
    my ( $biblionumber, undef ) = C4::Biblio::AddBiblio($marc_record, '');
Lines 208-213 subtest 'custom_cover_image_url' => sub { Link Here
208
208
209
    t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%024$a%.png' );
209
    t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%024$a%.png' );
210
    is( $biblio->custom_cover_image_url, "https://my_url/$marc_024a.png" );
210
    is( $biblio->custom_cover_image_url, "https://my_url/$marc_024a.png" );
211
212
    t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%normalized_isbn%.png' );
213
    my $normalized_isbn = C4::Koha::GetNormalizedISBN($isbn);
214
    is( $biblio->custom_cover_image_url, "https://my_url/$normalized_isbn.png" );
211
};
215
};
212
216
213
$schema->storage->txn_rollback;
217
$schema->storage->txn_rollback;
214
- 

Return to bug 22445