Bug 15485: (QA followup) Fix behaviour and default values
[koha.git] / virtualshelves / shelves.pl
index 8130c45..98ff255 100755 (executable)
@@ -215,7 +215,9 @@ if ( $op eq 'view' ) {
 
             my $borrower = GetMember( borrowernumber => $loggedinuser );
 
-            my $xslfile = C4::Context->preference('XSLTResultsDisplay');
+            # Lists display falls back to search results configuration
+            my $xslfile = C4::Context->preference('XSLTListsDisplay') ||
+                          C4::Context->preference('XSLTResultsDisplay');
             my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
             my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
 
@@ -226,12 +228,13 @@ if ( $op eq 'view' ) {
                 my $record       = GetMarcBiblio($biblionumber);
 
                 if ( $xslfile ) {
-                    $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTResultsDisplay",
+                    $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay",
                                                                 1, undef, $sysxml, $xslfile, $lang);
                 }
 
                 my $marcflavour = C4::Context->preference("marcflavour");
                 my $itemtypeinfo = getitemtypeinfo( $content->biblionumber->biblioitems->first->itemtype, 'intranet' );
+                $this_item->{title}             = $content->biblionumber->title;
                 $this_item->{author}            = $content->biblionumber->author;
                 $this_item->{dateadded}         = $content->dateadded;
                 $this_item->{imageurl}          = $itemtypeinfo->{imageurl};