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

(-)a/catalogue/detail.pl (-14 / +15 lines)
Lines 124-145 my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; Link Here
124
124
125
if ( $xslfile ) {
125
if ( $xslfile ) {
126
126
127
    my $searcher = Koha::SearchEngine::Search->new(
127
    my $analytics_count = 0;
128
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
128
    eval {
129
    );
129
        my $searcher = Koha::SearchEngine::Search->new(
130
    my $cleaned_title = $biblio->title;
130
            { index => $Koha::SearchEngine::BIBLIOS_INDEX }
131
    $cleaned_title =~ tr|/||;
131
        );
132
    my $query =
132
        my $cleaned_title = $biblio->title;
133
      ( C4::Context->preference('UseControlNumber') and $record->field('001') )
133
        $cleaned_title =~ tr|/||;
134
      ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)'
134
        my $query =
135
      : "Host-item:($cleaned_title)";
135
          ( C4::Context->preference('UseControlNumber') and $record->field('001') )
136
    my ( $err, $result, $count ) = $searcher->simple_search_compat( $query, 0, 0 );
136
          ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)'
137
137
          : "Host-item:($cleaned_title)";
138
    warn "Warning from simple_search_compat: $err"
138
        my ( $err, $result, $analytics_count ) = $searcher->simple_search_compat( $query, 0, 0 );
139
        if $err;
139
        warn "Warning from simple_search_compat: $err" if $err;
140
    };
140
141
141
    my $variables = {
142
    my $variables = {
142
        show_analytics_link => $count > 0 ? 1 : 0
143
        show_analytics_link => $analytics_count > 0 ? 1 : 0
143
    };
144
    };
144
145
145
    $template->param(
146
    $template->param(
(-)a/opac/opac-detail.pl (-15 / +15 lines)
Lines 180-202 my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; Link Here
180
180
181
if ( $xslfile ) {
181
if ( $xslfile ) {
182
182
183
    my $searcher = Koha::SearchEngine::Search->new(
183
    my $analytics_count = 0;
184
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
184
    eval {
185
    );
185
        my $searcher = Koha::SearchEngine::Search->new(
186
    my $cleaned_title = $biblio->title;
186
            { index => $Koha::SearchEngine::BIBLIOS_INDEX }
187
    $cleaned_title =~ tr|/||;
187
        );
188
    my $query =
188
        my $cleaned_title = $biblio->title;
189
      ( C4::Context->preference('UseControlNumber') and $record->field('001') )
189
        $cleaned_title =~ tr|/||;
190
      ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)'
190
        my $query =
191
      : "Host-item:($cleaned_title)";
191
          ( C4::Context->preference('UseControlNumber') and $record->field('001') )
192
    my ( $err, $result, $count ) = $searcher->simple_search_compat( $query, 0, 0 );
192
          ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)'
193
193
          : "Host-item:($cleaned_title)";
194
    warn "Warning from simple_search_compat: $err"
194
        my ( $err, $result, $analytics_count ) = $searcher->simple_search_compat( $query, 0, 0 );
195
        if $err;
195
        warn "Warning from simple_search_compat: $err" if $err;
196
    };
196
197
197
    my $variables = {
198
    my $variables = {
198
        anonymous_session   => ($borrowernumber) ? 0 : 1,
199
        anonymous_session   => ($borrowernumber) ? 0 : 1,
199
        show_analytics_link => $count > 0 ? 1 : 0
200
        show_analytics_link => $analytics_count > 0 ? 1 : 0
200
    };
201
    };
201
202
202
    my @plugin_responses = Koha::Plugins->call(
203
    my @plugin_responses = Koha::Plugins->call(
203
- 

Return to bug 28682