Bug 23670

Summary: Load Koha::Exceptions::ElasticSearch module in Koha::SearchEngine::Elasticsearch
Product: Koha Reporter: Nicolas Legrand <nicolas.legrand>
Component: Searching - ElasticsearchAssignee: Nicolas Legrand <nicolas.legrand>
Status: CLOSED FIXED QA Contact: Nick Clemens <nick>
Severity: trivial    
Priority: P5 - low CC: katrin.fischer, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00
Bug Depends on:    
Bug Blocks: 23671    
Attachments: Bug 23670 Load Koha::Exceptions::ElasticSearch module in Koha::SearchEngine::Elasticsearch
Bug 23670 Load Koha::Exceptions::ElasticSearch module in Koha::SearchEngine::Elasticsearch
Bug 23670 Load Koha::Exceptions::ElasticSearch module in Koha::SearchEngine::Elasticsearch

Description Nicolas Legrand 2019-09-23 16:27:11 UTC
When your mapping includes an Invalid MARC field expression, it tries to throw an exception with Koha::Exceptions::Elasticsearch::MARCFieldExprParseError. But since Koha::Exceptions::Elasticsearch isn't loaded in Koha::SearchEngine::Elasticsearch, it dies like this:

Can't locate Koha/Exceptions/Elasticsearch/MARCFieldExprParseError.pm in @INC (you may need to install the Koha::Exceptions::Elasticsearch::MARCFieldExprParseError module)
Comment 1 Nicolas Legrand 2019-09-23 16:37:07 UTC
Created attachment 93132 [details] [review]
Bug 23670 Load Koha::Exceptions::ElasticSearch module in Koha::SearchEngine::Elasticsearch

Prevent Koha::SearchEngine::Elasticsearch from dying when trying to run
Koha::Exceptions::Elasticsearch::MARCFieldExprParseError->throw()

Plan test:

1. Go to Administration -> Searchengine configuration, and add a mapping
   for 995Z, whatever the search field (I did it with local-classification),
   save
2. run $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
3. see it die asking for Koha::Exceptions::Elasticsearch
4. apply patch
5. rerun $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
6. see it throw: Invalid MARC field expression: 995Z
Comment 2 Séverine Queune 2019-10-01 12:30:03 UTC
Created attachment 93361 [details] [review]
Bug 23670 Load Koha::Exceptions::ElasticSearch module in Koha::SearchEngine::Elasticsearch

Prevent Koha::SearchEngine::Elasticsearch from dying when trying to run
Koha::Exceptions::Elasticsearch::MARCFieldExprParseError->throw()

Plan test:

1. Go to Administration -> Searchengine configuration, and add a mapping
   for 995Z, whatever the search field (I did it with local-classification),
   save
2. run $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
3. see it die asking for Koha::Exceptions::Elasticsearch
4. apply patch
5. rerun $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
6. see it throw: Invalid MARC field expression: 995Z

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 3 Katrin Fischer 2019-10-03 12:01:35 UTC
Nicolas, please remember to add youself as Assignee on your bugs :)
Comment 4 Nick Clemens 2019-10-04 09:59:10 UTC
Created attachment 93727 [details] [review]
Bug 23670 Load Koha::Exceptions::ElasticSearch module in Koha::SearchEngine::Elasticsearch

Prevent Koha::SearchEngine::Elasticsearch from dying when trying to run
Koha::Exceptions::Elasticsearch::MARCFieldExprParseError->throw()

Plan test:

1. Go to Administration -> Searchengine configuration, and add a mapping
   for 995Z, whatever the search field (I did it with local-classification),
   save
2. run $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
3. see it die asking for Koha::Exceptions::Elasticsearch
4. apply patch
5. rerun $KOHA_PATH/misc/search_tools/rebuild_elasticsearch.pl -v -d -b
6. see it throw: Invalid MARC field expression: 995Z

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Martin Renvoize 2019-10-07 11:58:26 UTC
Nice work!

Pushed to master for 19.11.00