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

(-)a/Koha/OAI/Server/Repository.pm (-2 / +8 lines)
Lines 198-210 sub get_biblio_marcxml { Link Here
198
        $record         = $biblio->metadata->record_strip_nonxml( { embed_items => $with_items, opac => 1 } );
198
        $record         = $biblio->metadata->record_strip_nonxml( { embed_items => $with_items, opac => 1 } );
199
    }
199
    }
200
    if ($record) {
200
    if ($record) {
201
        if ( C4::Context->preference('OpacSuppression') ) {
202
203
            #NOTE: See Koha::Biblio->metadata_extractor->get_opac_suppression()
204
            my $suppressed = $record->subfield( '942', 'n' ) ? 1 : 0;
205
            if ($suppressed) {
206
                return;
207
            }
208
        }
201
209
202
        my $rules = C4::Context->yaml_preference('OpacHiddenItems') // {};
210
        my $rules = C4::Context->yaml_preference('OpacHiddenItems') // {};
203
        if ( $biblio->hidden_in_opac( { rules => $rules } ) ) {
211
        if ( $biblio->hidden_in_opac( { rules => $rules } ) ) {
204
            return;
212
            return;
205
        }
213
        }
206
214
207
        #TODO: Also hide record if OpacSuppression is in use
208
    }
215
    }
209
216
210
    return ( $record ? $record->as_xml_record( C4::Context->preference('marcflavour') ) : undef, $decoding_error );
217
    return ( $record ? $record->as_xml_record( C4::Context->preference('marcflavour') ) : undef, $decoding_error );
211
- 

Return to bug 37713