Skip to content

Commit c15d5af

Browse files
committed
TASK: Load the configuration from Neos.ContentRepository.Search
1 parent 5c36e96 commit c15d5af

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

Classes/Service/NodeTypeIndexingConfiguration.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class NodeTypeIndexingConfiguration
2222
{
2323
/**
2424
* @var array
25-
* @Flow\InjectConfiguration(path="configuration")
25+
* @Flow\InjectConfiguration(path="configuration.nodeTypes", package="Neos.ContentRepository.Search")
2626
*/
2727
protected $settings;
2828

@@ -33,27 +33,21 @@ final class NodeTypeIndexingConfiguration
3333
*/
3434
public function isIndexable(NodeType $nodeType)
3535
{
36-
if (!isset($this->settings['nodeTypes'])) {
36+
if ($this->settings === null || !\is_array($this->settings)) {
3737
return true;
3838
}
3939

40-
if (!\is_array($this->settings['nodeTypes'])) {
41-
throw new Exception('Check your configuration at indexingConfiguration.nodeTypes, this path must be an array', 1504721629);
42-
}
43-
44-
$settings = $this->settings['nodeTypes'];
45-
46-
if (isset($settings[$nodeType->getName()]['indexed'])) {
47-
return $settings[$nodeType->getName()]['indexed'];
40+
if (isset($this->settings[$nodeType->getName()]['indexed'])) {
41+
return (bool)$this->settings[$nodeType->getName()]['indexed'];
4842
}
4943

5044
$nodeTypeParts = \explode(':', $nodeType->getName());
5145
$namespace = reset($nodeTypeParts) . ':*';
52-
if (isset($settings[$namespace]['indexed'])) {
53-
return $settings[$namespace]['indexed'];
46+
if (isset($this->settings[$namespace]['indexed'])) {
47+
return (bool)$this->settings[$namespace]['indexed'];
5448
}
55-
if (isset($settings['*']['indexed'])) {
56-
return $settings['*']['indexed'];
49+
if (isset($this->settings['*']['indexed'])) {
50+
return (bool)$this->settings['*']['indexed'];
5751
}
5852

5953
return false;

0 commit comments

Comments
 (0)