Bug 12745

Summary: Add a sanity check for QueryParser configuration on about.pl
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, veron
Version: master   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 12742    
Attachments: Bug 12745: Add a sanity check for QueryParser configuration on about.pl
Bug 12745: Add a sanity check for QueryParser configuration on about.pl
Bug 12745: (QA followup) remove misleading 'No warnings' message
[PASSED QA] Bug 12745: Add a sanity check for QueryParser configuration on about.pl
[PASSED QA] Bug 12745: (QA followup) remove misleading 'No warnings' message

Description Tomás Cohen Arazi 2014-08-11 15:08:45 UTC
Currently there's no way for the user to know he has a bad QueryParser configuration. Koha would just fallback to not using it.

We should have a warning for this on about.pl
Comment 1 Tomás Cohen Arazi 2014-08-11 15:59:37 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2014-08-11 18:47:25 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-08-15 14:54:54 UTC
With the typo in the path (non existing file), 'no warnings' is stil shown
below the warnings.
Comment 4 Tomás Cohen Arazi 2014-08-15 15:59:08 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2014-08-15 16:36:55 UTC
Created attachment 30848 [details] [review]
[PASSED QA] Bug 12745: Add a sanity check for QueryParser configuration on about.pl

Currently there's no way for the user to know he has a bad QueryParser configuration.
Koha would just fallback to not using it.

This patch adds a check for QueryParser configuration sanity in about.pl

To test:
- Have UseQueryParser = "Don't try"
- Go to More > About Koha > System information
- No QueryParser-related warnings
- Set UseQueryParser = "Try"
- Go to More > About Koha > System information
- On a normal setup you shouldn't have any QueryParser-related warnings
- Edit your koha-conf.xml file and change the queryparser_config entry to a
  non-existent filename.
- Reload More > About Koha > System information
=> SUCCESS: a warning message tells you the filename used, and says it failed.
- Now just delete the entry in koha-conf.xml
- Reload More > About Koha > System information
=> SUCCESS: a warning message tells you don't have the queryparser_entry in
  your koha-conf.xml file.
  Subtest:
  a - The file /etc/koha/searchengine/queryparser.yaml exists:
    => SUCCESS: a warning saying it used a fallback is shown
  b - The file doesn't exist
    => SUCCESS: Missing entry warning, plus a failure message for the fallback.
- Sign off :-D

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
With the typo in the path (non existing file), 'no warnings' is stil shown
below the warnings. The follow-up fixes that.
Comment 6 Katrin Fischer 2014-08-15 16:36:59 UTC
Created attachment 30849 [details] [review]
[PASSED QA] Bug 12745: (QA followup) remove misleading 'No warnings' message

Current code displays "No warnings" even if there are actually warnings
printed.

It is not related to the bug itself, but as it was pointed out by the QAM,
I attach a followup to solve that.

Regards
To+

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 7 Tomás Cohen Arazi 2014-08-15 18:01:20 UTC
Patch pushed to master.