7
7
8
8
namespace Magento \Setup \Model ;
9
9
10
+ use Magento \Framework \App \Config ;
10
11
use Magento \Framework \Setup \Option \AbstractConfigOption ;
11
12
use Magento \Framework \Validation \ValidationException ;
12
13
use Magento \Search \Model \SearchEngine \Validator ;
@@ -33,19 +34,27 @@ class SearchConfig
33
34
*/
34
35
private $ installConfig ;
35
36
37
+ /**
38
+ * @var Config
39
+ */
40
+ private $ appConfig ;
41
+
36
42
/**
37
43
* @param SearchConfigOptionsList $searchConfigOptionsList
38
44
* @param Validator $searchValidator
39
45
* @param CompositeInstallConfig $installConfig
46
+ * @param Config $appConfig
40
47
*/
41
48
public function __construct (
42
49
SearchConfigOptionsList $ searchConfigOptionsList ,
43
50
Validator $ searchValidator ,
44
- CompositeInstallConfig $ installConfig
51
+ CompositeInstallConfig $ installConfig ,
52
+ Config $ appConfig
45
53
) {
46
54
$ this ->searchConfigOptionsList = $ searchConfigOptionsList ;
47
55
$ this ->searchValidator = $ searchValidator ;
48
56
$ this ->installConfig = $ installConfig ;
57
+ $ this ->appConfig = $ appConfig ;
49
58
}
50
59
51
60
/**
@@ -76,6 +85,9 @@ public function saveConfiguration(array $inputOptions)
76
85
*/
77
86
public function validateSearchEngine ()
78
87
{
88
+ //Clean config cache prior to validation
89
+ $ this ->appConfig ->clean ();
90
+
79
91
$ validationErrors = $ this ->searchValidator ->validate ();
80
92
if (!empty ($ validationErrors )) {
81
93
throw new ValidationException (__ (implode (PHP_EOL , $ validationErrors )));
0 commit comments