Bug 20484

Summary: Always show Elasticsearch configuration page when permission is set
Product: Koha Reporter: Liz Rea <liz>
Component: System AdministrationAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, andrewfh, gmcharlt, lucas, m.de.rooy, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06
Attachments: Bug 20484: Allow configuration of ES before switching to ES
Bug 20484: Allow configuration of ES before switching to ES
Bug 20484: Allow configuration of ES before switching to ES
Bug 20484: Implement blocking_errors for ES config page

Description Liz Rea 2018-03-28 02:55:26 UTC
Not a big deal, but one can access /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl without the Elasticsearch Search engine preference enabled.
Comment 1 Nick Clemens 2020-04-03 13:50:00 UTC
I think this is actually a feature. We should rename the page to 'Elasticsearch search configuartion' and have a note that it only applies to ES.

This would allow users to tweak the ES settings before switching to Elasticsearch as their engine
Comment 2 Nick Clemens 2020-04-08 10:15:05 UTC
Created attachment 102549 [details] [review]
Bug 20484: Allow configuration of ES before switching to ES

To test:
1 - Set SearchEngine syspref to Zebra
2 - Be a user with permission to manage search engine configuration (manage_search_engine_config)
3 - Confirm you do not see 'Search engine configuration' on Admin main page
4 - Apply patch
5 - Confirm you see it with '(Elasticsearch)' appended
6 - Be a user without above permission
7 - Confirm you cannot see the 'Search engine configuration'
8 - Confirm you cannot access directly:
    /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
Comment 3 Andrew Fuerste-Henry 2020-04-08 12:50:08 UTC
Created attachment 102566 [details] [review]
Bug 20484: Allow configuration of ES before switching to ES

To test:
1 - Set SearchEngine syspref to Zebra
2 - Be a user with permission to manage search engine configuration (manage_search_engine_config)
3 - Confirm you do not see 'Search engine configuration' on Admin main page
4 - Apply patch
5 - Confirm you see it with '(Elasticsearch)' appended
6 - Be a user without above permission
7 - Confirm you cannot see the 'Search engine configuration'
8 - Confirm you cannot access directly:
    /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 4 Marcel de Rooy 2020-04-10 08:26:07 UTC
You might want to take into account that not all modules have been installed when not using Elastic??

Could not compile /usr/share/koha/admin/searchengine/elasticsearch/mappings.pl: Can't locate Catmandu/Importer/MARC.pm in @INC (you may need to install the Catmandu::Importer::MARC module) (@INC contains: /usr/share/koha /usr/share/koha/installer /usr/share/koha/lib/installer /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base /var/lib/koha/master/plugins) at /usr/share/koha/Koha/SearchEngine/Elasticsearch/Indexer.pm line 28.
BEGIN failed--compilation aborted at /usr/share/koha/Koha/SearchEngine/Elasticsearch/Indexer.pm line 28.
Compilation failed in require at /usr/share/koha/admin/searchengine/elasticsearch/mappings.pl line 27.
BEGIN failed--compilation aborted at /usr/share/koha/admin/searchengine/elasticsearch/mappings.pl line 27.
Comment 5 Katrin Fischer 2020-04-18 03:20:45 UTC
Created attachment 103195 [details] [review]
Bug 20484: Allow configuration of ES before switching to ES

To test:
1 - Set SearchEngine syspref to Zebra
2 - Be a user with permission to manage search engine configuration (manage_search_engine_config)
3 - Confirm you do not see 'Search engine configuration' on Admin main page
4 - Apply patch
5 - Confirm you see it with '(Elasticsearch)' appended
6 - Be a user without above permission
7 - Confirm you cannot see the 'Search engine configuration'
8 - Confirm you cannot access directly:
    /cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2020-04-18 03:22:42 UTC
Hm, missed Marcel's comment#4 - I will leave the status for now.

Search engine configuration (Elasticsearch) is a bit long, wonder if we could discuss: Elasticsearch configuration as a title  (next iteration, different bug).
Comment 7 Martin Renvoize 2020-04-20 12:38:18 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Martin Renvoize 2020-04-20 14:35:41 UTC
Hmm.. I missed comment 4 too :(.

I can either revert or preferably we could have a followup that adds a method to check if the required dependencies are installed?
Comment 9 Nick Clemens 2020-04-21 10:55:59 UTC
Created attachment 103362 [details] [review]
Bug 20484: Implement blocking_errors for ES config page
Comment 10 Martin Renvoize 2020-04-21 11:14:55 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-05-07 21:53:01 UTC
Backported to 19.11.x for 19.11.06
Comment 12 Lucas Gass 2020-05-14 17:59:17 UTC
enhancement will not be backported to 19.05.x