Bug 18446

Summary: Test to ensure a system preference in .pref file also exists in sysprefs.sql
Product: Koha Reporter: Lari Taskula <lari.taskula>
Component: Test SuiteAssignee: Lari Taskula <lari.taskula>
Status: Failed QA --- QA Contact: Galen Charlton <gmcharlt>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy, veron
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18444
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18513
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 18446: Compare preferences in .pref files to sysprefs.sql

Description Lari Taskula 2017-04-18 14:35:09 UTC
Extend t/db_dependent/check_sysprefs.t to read preferences from .pref files in order to check that they are also defined in installer/data/mysql/sysprefs.sql.
Comment 1 Lari Taskula 2017-04-18 14:38:22 UTC
Created attachment 62298 [details] [review]
Bug 18446: Compare preferences in .pref files to sysprefs.sql

This patch adds a test that reads system preferences from .pref files and checks
that they are also defined in sysprefs.sql.

To test:
1. prove t/db_dependent/check_sysprefs.t
Comment 2 Lari Taskula 2017-04-18 14:40:12 UTC
This test caught the following preferences:

ArticleRequestsMandatoryFieldsItemOnly, 
HoldsInNoissuesCharge, 
NoRenewalBeforePrecision, 
OPACPopupAuthorsSearch, 
OPACPrivacy, 
OPACSuggestionMandatoryFields, 
OpacGroupResults, 
ReplytoDefault, 
SelfCheckoutByLogin, 
TalkingTechItivaPhoneNotification, 
marcflavour

Add them to sysprefs.sql to make this test pass.
Comment 3 Marcel de Rooy 2017-04-18 14:59:52 UTC
There are a few exceptions like marcflavour
Comment 4 Marcel de Rooy 2017-04-18 15:00:19 UTC
(In reply to Marcel de Rooy from comment #3)
> There are a few exceptions like marcflavour

Should be filled by the user in the web installer.
Comment 5 Katrin Fischer 2017-05-01 13:02:05 UTC
I think before this can go in, we need 2 things:
- Exclude marcflavour as it is added and set by the web installer
- Write a patch to add the missing preferences to syspref.sql and maybe also have an atomicupdate checking for their existence and adding when needed to get to a clean state.