Bug 18822: Check if we have MARC::Record and convert if not when using ES
The new_record_from_zebra subroutine assumes that when using ES we
always get MARC::Record objects when using ES, but sometimes we get them as xml via Z39 or
internally. This adds a test to new_from_zebra to confirm we have a
record object and to convert it if not
To test:
1 - Perform an advanced search from the advanced editor, make sure to
select 'Local catalog' and a remote source
2 - Error 'Internal search error [Object object]'
3 - Apply patch
4 - Repeat search, success!
5 - Select and deselect various servers, search should still work
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 49db39c060)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
ceb93b2da0
commit
0865b082d2
|
|
@ -2506,7 +2506,7 @@ sub new_record_from_zebra {
|
|||
# Set the default indexing modes
|
||||
my $search_engine = C4::Context->preference("SearchEngine");
|
||||
if ($search_engine eq 'Elasticsearch') {
|
||||
return $raw_data;
|
||||
return ref $raw_data eq 'MARC::Record' ? $raw_data : MARC::Record->new_from_xml( $raw_data, 'UTF-8' );
|
||||
}
|
||||
my $index_mode = ( $server eq 'biblioserver' )
|
||||
? C4::Context->config('zebra_bib_index_mode') // 'dom'
|
||||
|
|
|
|||
Loading…
Reference in New Issue