@@ -48,12 +48,14 @@ public function __construct(
48
48
public function saveConfiguration (array $ inputOptions )
49
49
{
50
50
$ searchConfigOptions = $ this ->extractSearchOptions ($ inputOptions );
51
- $ this ->validateSearchEngineSelection ($ searchConfigOptions );
51
+ if (!empty ($ searchConfigOptions [SearchConfigOptionsList::INPUT_KEY_SEARCH_ENGINE ])) {
52
+ $ this ->validateSearchEngineSelection ($ searchConfigOptions );
52
53
53
- try {
54
- $ this ->installConfig ->configure ($ searchConfigOptions );
55
- } catch (InputException $ e ) {
56
- throw new SetupException ($ e ->getMessage ());
54
+ try {
55
+ $ this ->installConfig ->configure ($ searchConfigOptions );
56
+ } catch (InputException $ e ) {
57
+ throw new SetupException ($ e ->getMessage ());
58
+ }
57
59
}
58
60
}
59
61
@@ -65,9 +67,11 @@ public function saveConfiguration(array $inputOptions)
65
67
*/
66
68
private function validateSearchEngineSelection (array $ searchOptions )
67
69
{
68
- $ selectedEngine = $ searchOptions [SearchConfigOptionsList::INPUT_KEY_SEARCH_ENGINE ];
69
- if (!in_array ($ selectedEngine , SearchConfigOptionsList::AVAILABLE_SEARCH_ENGINES )) {
70
- throw new SetupException ("Search engine ' {$ selectedEngine }' is not an available search engine. " );
70
+ if (isset ($ searchOptions [SearchConfigOptionsList::INPUT_KEY_SEARCH_ENGINE ])) {
71
+ $ selectedEngine = $ searchOptions [SearchConfigOptionsList::INPUT_KEY_SEARCH_ENGINE ];
72
+ if (!in_array ($ selectedEngine , SearchConfigOptionsList::AVAILABLE_SEARCH_ENGINES )) {
73
+ throw new SetupException ("Search engine ' {$ selectedEngine }' is not an available search engine. " );
74
+ }
71
75
}
72
76
}
73
77
0 commit comments