Skip to content

Commit 4029b7a

Browse files
committed
TASK: Fix problems originated by the upmerge
1 parent b8d29ec commit 4029b7a

2 files changed

Lines changed: 16 additions & 18 deletions

File tree

Classes/Driver/AbstractNodeTypeMappingBuilder.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* source code.
1212
*/
1313

14+
use Neos\Error\Messages\Result;
1415
use Neos\Flow\Annotations as Flow;
1516
use Neos\Flow\Configuration\Exception\InvalidConfigurationTypeException;
16-
use Neos\Flow\Error;
1717
use Neos\Flow\Configuration\ConfigurationManager;
1818
use Neos\Flow\ObjectManagement\ObjectManagerInterface;
1919
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
@@ -44,6 +44,11 @@ abstract class AbstractNodeTypeMappingBuilder implements NodeTypeMappingBuilderI
4444
*/
4545
protected $configurationManager;
4646

47+
/**
48+
* @var Result
49+
*/
50+
protected $lastMappingErrors;
51+
4752
/**
4853
* Called by the Flow object framework after creating the object and resolving all dependencies.
4954
*
@@ -69,7 +74,9 @@ public static function convertNodeTypeNameToMappingName($nodeTypeName)
6974
return str_replace('.', '-', $nodeTypeName);
7075
}
7176

72-
77+
/**
78+
* @return Result
79+
*/
7380
public function getLastMappingErrors()
7481
{
7582
return $this->lastMappingErrors;

Classes/Driver/Version1/Mapping/NodeTypeMappingBuilder.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
use Neos\ContentRepository\Domain\Model\NodeType;
1919
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
2020
use Neos\Error\Messages\Result;
21+
use Neos\Error\Messages\Warning;
2122
use Neos\Flow\Annotations as Flow;
2223
use Neos\Flow\Configuration\ConfigurationManager;
24+
use Neos\Flow\Configuration\Exception\InvalidConfigurationTypeException;
25+
use Neos\Flow\ObjectManagement\ObjectManagerInterface;
2326

2427
/**
2528
* NodeTypeMappingBuilder for Elasticsearch version 1.x
@@ -41,11 +44,6 @@ class NodeTypeMappingBuilder extends AbstractNodeTypeMappingBuilder
4144
*/
4245
protected $nodeTypeManager;
4346

44-
/**
45-
* @var Result
46-
*/
47-
protected $lastMappingErrors;
48-
4947
/**
5048
* @Flow\Inject
5149
* @var ConfigurationManager
@@ -56,11 +54,12 @@ class NodeTypeMappingBuilder extends AbstractNodeTypeMappingBuilder
5654
* Called by the Flow object framework after creating the object and resolving all dependencies.
5755
*
5856
* @param integer $cause Creation cause
57+
* @throws InvalidConfigurationTypeException
5958
*/
6059
public function initializeObject($cause)
6160
{
62-
if ($cause === \Neos\Flow\ObjectManagement\ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED) {
63-
$settings = $this->configurationManager->getConfiguration(\Neos\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.ContentRepository.Search');
61+
if ($cause === ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED) {
62+
$settings = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.ContentRepository.Search');
6463
$this->defaultConfigurationPerType = $settings['defaultConfigurationPerType'];
6564
}
6665
}
@@ -126,7 +125,7 @@ public function buildMappingInformation(Index $index)
126125
$mapping->setPropertyByPath($propertyName, $this->defaultConfigurationPerType[$propertyConfiguration['type']]['elasticSearchMapping']);
127126
}
128127
} else {
129-
$this->lastMappingErrors->addWarning(new \Neos\Error\Messages\Warning('Node Type "' . $nodeTypeName . '" - property "' . $propertyName . '": No ElasticSearch Mapping found.'));
128+
$this->lastMappingErrors->addWarning(new Warning('Node Type "' . $nodeTypeName . '" - property "' . $propertyName . '": No ElasticSearch Mapping found.'));
130129
}
131130
}
132131

@@ -135,12 +134,4 @@ public function buildMappingInformation(Index $index)
135134

136135
return $mappings;
137136
}
138-
139-
/**
140-
* @return Result
141-
*/
142-
public function getLastMappingErrors()
143-
{
144-
return $this->lastMappingErrors;
145-
}
146137
}

0 commit comments

Comments
 (0)