From 32796a847f793267aa72c1fe4315edf2ff49db09 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 4 Nov 2008 18:44:35 +0100 Subject: [PATCH] fix for bug 1771: Template errors with remote itemtype image This adds a new function, getitemtypeimagelocation, that returns the image unmodified for absolute urls and returns the proper intranet or opac path otherwise. It also updates all of the relevant files to use that function. Signed-off-by: Galen Charlton Conflicts: C4/Koha.pm catalogue/search.pl opac/opac-search.pl --- C4/Koha.pm | 2 +- members/moremember.pl | 2 +- opac/opac-search.pl | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index b5e87f663f..699c0cd9bc 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -483,7 +483,7 @@ sub getitemtypeimagesrc { sub getitemtypeimagelocation($$) { my ( $src, $image ) = @_; - return '' if ( !$image ); + return if ( !$image ); my $scheme = ( uri_split( $image ) )[0]; diff --git a/members/moremember.pl b/members/moremember.pl index 478969b099..ea49ea41cd 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -240,7 +240,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { my $itemtypeinfo = getitemtypeinfo($itemtype); $row{'itemtype_description'} = $itemtypeinfo->{description}; - $row{'itemtype_image'} = $itemtypeinfo->{imageurl}; + $row{'itemtype_image'} = getitemtypelocation( 'opac', $itemtypeinfo->{imageurl} ); $row{'charge'} = sprintf( "%.2f", $charge ); diff --git a/opac/opac-search.pl b/opac/opac-search.pl index ddccb84280..21dc131311 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -138,7 +138,7 @@ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { my %row =( number=>$cnt++, - ccl => $itype_or_itemtype, + ccl => $itype_or_itemtype, code => $thisitemtype, selected => $selected, description => $itemtypes->{$thisitemtype}->{'description'}, @@ -153,8 +153,8 @@ if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { my $advsearchtypes = GetAuthorisedValues($advanced_search_types); for my $thisitemtype (@$advsearchtypes) { my %row =( - number=>$cnt++, - ccl => $advanced_search_types, + number=>$cnt++, + ccl => $advanced_search_types, code => $thisitemtype->{authorised_value}, selected => $selected, description => $thisitemtype->{'lib'}, -- 2.39.5