12
12
use Magento \Framework \App \ObjectManagerFactory ;
13
13
use Magento \Framework \App \Config \ScopeConfigInterface ;
14
14
use Magento \Framework \Console \Cli ;
15
- use Magento \SharedCatalog \Model \State as SharedCatalogState ;
16
15
use Symfony \Component \Console \Input \InputArgument ;
17
16
18
17
/**
@@ -37,27 +36,26 @@ class IndexerShowDimensionsModeCommand extends AbstractIndexerCommand
37
36
* @var string[]
38
37
*/
39
38
private $ indexers ;
40
-
41
39
/**
42
- * @var SharedCatalogState
40
+ * @var string[]
43
41
*/
44
- private $ sharedCatalogState ;
42
+ private $ optionalIndexers ;
45
43
46
44
/**
47
45
* @param ObjectManagerFactory $objectManagerFactory
48
46
* @param ScopeConfigInterface $configReader
49
- * @param SharedCatalogState $sharedCatalogState
50
47
* @param array $indexers
48
+ * @param array $optionalIndexers
51
49
*/
52
50
public function __construct (
53
51
ObjectManagerFactory $ objectManagerFactory ,
54
52
ScopeConfigInterface $ configReader ,
55
- SharedCatalogState $ sharedCatalogState ,
56
- array $ indexers
53
+ array $ indexers ,
54
+ array $ optionalIndexers
57
55
) {
58
56
$ this ->configReader = $ configReader ;
59
- $ this ->sharedCatalogState = $ sharedCatalogState ;
60
57
$ this ->indexers = $ indexers ;
58
+ $ this ->optionalIndexers = $ optionalIndexers ;
61
59
parent ::__construct ($ objectManagerFactory );
62
60
}
63
61
@@ -101,9 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
101
99
$ output ->writeln (sprintf ('%-50s ' , $ indexer ->getTitle () . ': ' ) . $ mode );
102
100
}
103
101
} catch (\Exception $ e ) {
104
- if ($ indexerId === 'catalogpermissions_category ' && !$ this ->sharedCatalogState ->isGlobal ()) {
105
- // do nothing
106
- } else {
102
+ if (!in_array ($ indexerId , $ this ->optionalIndexers )) {
107
103
$ output ->writeln ('" ' . $ indexer ->getTitle () . '" indexer process unknown error: ' . PHP_EOL );
108
104
$ output ->writeln ($ e ->getMessage () . PHP_EOL );
109
105
// we must have an exit code higher than zero to indicate something was wrong
0 commit comments