|
@@ -16,8 +16,8 @@ discard block |
|
|
block discarded – undo |
|
16
|
16
|
$dispatcher = $bootstrap->getSignalSlotDispatcher(); |
|
17
|
17
|
$newUriPathSegment = NULL; |
|
18
|
18
|
$dispatcher->connect('TYPO3\TYPO3CR\Domain\Model\Node', 'nodePropertyChanged', function(Node $node, $propertyName, $oldValue, $newValue) use($bootstrap, &$newUriPathSegment) { |
|
19
|
|
- $q = new FlowQuery(array($node)); |
|
20
|
|
- $q = $q->context(array('invisibleContentShown' => true, 'removedContentShown' => true, 'inaccessibleContentShown' => true)); |
|
|
19
|
+ $q = new FlowQuery(array($node)); |
|
|
20
|
+ $q = $q->context(array('invisibleContentShown' => true, 'removedContentShown' => true, 'inaccessibleContentShown' => true)); |
|
21
|
21
|
|
|
22
|
22
|
if ($propertyName === 'title' && $node->getNodeType()->isOfType('TYPO3.Neos:Document')) { |
|
23
|
23
|
if (method_exists('TYPO3\Neos\Utility\NodeUriPathSegmentGenerator', 'generateUriPathSegment')) { |
|
@@ -28,20 +28,20 @@ discard block |
|
|
block discarded – undo |
|
28
|
28
|
} |
|
29
|
29
|
|
|
30
|
30
|
$initialUriPathSegment = $newUriPathSegment; |
|
31
|
|
- $i = 1; |
|
32
|
|
- while ($q->siblings('[instanceof TYPO3.Neos:Document][uriPathSegment="' . $newUriPathSegment . '"]')->count() > 0) { |
|
33
|
|
- $newUriPathSegment = $initialUriPathSegment . '-' . $i++; |
|
34
|
|
- } |
|
|
31
|
+ $i = 1; |
|
|
32
|
+ while ($q->siblings('[instanceof TYPO3.Neos:Document][uriPathSegment="' . $newUriPathSegment . '"]')->count() > 0) { |
|
|
33
|
+ $newUriPathSegment = $initialUriPathSegment . '-' . $i++; |
|
|
34
|
+ } |
|
35
|
35
|
|
|
36
|
36
|
$node->setProperty('uriPathSegment', $newUriPathSegment); |
|
37
|
37
|
$bootstrap->getObjectManager()->get('TYPO3\Neos\Routing\Cache\RouteCacheFlusher')->registerNodeChange($node); |
|
38
|
38
|
} elseif ($propertyName === 'uriPathSegment' && $newUriPathSegment !== NULL && $newValue !== $newUriPathSegment) { |
|
39
|
39
|
|
|
40
|
40
|
$initialUriPathSegment = $newUriPathSegment; |
|
41
|
|
- $i = 1; |
|
42
|
|
- while ($q->siblings('[instanceof TYPO3.Neos:Document][uriPathSegment="' . $newUriPathSegment . '"]')->count() > 0) { |
|
43
|
|
- $newUriPathSegment = $initialUriPathSegment . '-' . $i++; |
|
44
|
|
- } |
|
|
41
|
+ $i = 1; |
|
|
42
|
+ while ($q->siblings('[instanceof TYPO3.Neos:Document][uriPathSegment="' . $newUriPathSegment . '"]')->count() > 0) { |
|
|
43
|
+ $newUriPathSegment = $initialUriPathSegment . '-' . $i++; |
|
|
44
|
+ } |
|
45
|
45
|
|
|
46
|
46
|
$node->setProperty('uriPathSegment', $newUriPathSegment); |
|
47
|
47
|
$newUriPathSegment = NULL; |