Skip to content

Commit

Permalink
Merge branch '3.3' into 4.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	Neos.Neos/Configuration/NodeTypes.yaml
#	Neos.Neos/Resources/Private/Translations/de/Main.xlf
  • Loading branch information
mficzel committed Jun 4, 2019
2 parents 60e8d1a + c34de0c commit bc91482
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Classes/Eel/FlowQueryOperations/SortOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SortOperation extends AbstractOperation
*/
public function canEvaluate($context)
{
return count($context) === 0 || (isset($context[0]) && ($context[0] instanceof NodeInterface));
return count($context) === 0 || (is_array($context) === true && (current($context) instanceof NodeInterface));
}

/**
Expand Down
37 changes: 35 additions & 2 deletions Classes/Fusion/Cache/ContentCacheFlusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Neos\ContentRepository\Domain\Model\NodeType;
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
use Neos\Fusion\Core\Cache\ContentCache;
use Neos\Neos\Domain\Service\ContentContext;
use Neos\Neos\Domain\Service\ContentContextFactory;

/**
* This service flushes Fusion content caches triggered by node changes.
Expand Down Expand Up @@ -62,12 +64,23 @@ class ContentCacheFlusher
*/
protected $nodeTypeManager;

/**
* @Flow\Inject
* @var ContentContextFactory
*/
protected $contextFactory;

/**
* @Flow\Inject
* @var PersistenceManagerInterface
*/
protected $persistenceManager;

/**
* @var ContentContext[]
*/
protected $contexts = [];

/**
* Register a node change for a later cache flush. This method is triggered by a signal sent via ContentRepository's Node
* model or the Neos Publishing Service.
Expand Down Expand Up @@ -150,10 +163,11 @@ public function registerAssetChange(AssetInterface $asset)
continue;
}

$this->registerChangeOnNodeIdentifier($reference->getNodeIdentifier());
$this->registerChangeOnNodeType($reference->getNodeTypeName(), $reference->getNodeIdentifier());
$node = $this->getContextForReference($reference)->getNodeByIdentifier($reference->getNodeIdentifier());
$this->registerNodeChange($node);

$assetIdentifier = $this->persistenceManager->getIdentifierByObject($asset);
// @see RuntimeContentCache.addTag
$tagName = 'AssetDynamicTag_' . $assetIdentifier;
$this->tagsToFlush[$tagName] = sprintf('which were tagged with "%s" because asset "%s" has changed.', $tagName, $assetIdentifier);
}
Expand All @@ -176,6 +190,25 @@ public function shutdownObject()
}
}

/**
* @param AssetUsageInNodeProperties $assetUsage
* @return ContentContext
*/
protected function getContextForReference(AssetUsageInNodeProperties $assetUsage): ContentContext
{
$hash = md5(sprintf('%s-%s', $assetUsage->getWorkspaceName(), json_encode($assetUsage->getDimensionValues())));
if (!isset($this->contexts[$hash])) {
$this->contexts[$hash] = $this->contextFactory->create([
'workspaceName' => $assetUsage->getWorkspaceName(),
'dimensions' => $assetUsage->getDimensionValues(),
'invisibleContentShown' => true,
'inaccessibleContentShown' => true
]);
}

return $this->contexts[$hash];
}

/**
* @param NodeType $nodeType
* @return array<string>
Expand Down
4 changes: 3 additions & 1 deletion Classes/Service/LinkingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ public function createNodeUri(ControllerContext $controllerContext, $node = null
$uri = $request->getHttpRequest()->getBaseUri() . ltrim($uri, '/');
}
} elseif ($absolute === true) {
$uri = $request->getHttpRequest()->getBaseUri() . ltrim($uri, '/');
if (substr($uri, 0, 7) !== 'http://' && substr($uri, 0, 8) !== 'https://') {
$uri = $request->getHttpRequest()->getBaseUri() . ltrim($uri, '/');
}
}

return $uri;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Setup/Step/NeosSpecificRequirementsStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected function buildForm(FormDefinition $formDefinition)

if ($foundImageHandler === false) {
$formElement = $imageSection->createElement('noImageLibrary', 'Neos.Form:StaticText');
$formElement->setProperty('text', 'No suitable PHP extension for image manipulation was found. You can continue the setup but be aware that Neos might not work correctly without one of these extensions.');
$formElement->setProperty('text', 'No suitable PHP extension for image manipulation was found. Please install one of the required PHP extensions and restart the php process. Then proceed with the setup.');
$formElement->setProperty('elementClassAttribute', 'alert alert-error');
} else {
$formElement = $imageSection->createElement('configuredImageLibrary', 'Neos.Form:StaticText');
Expand Down
2 changes: 1 addition & 1 deletion Configuration/NodeTypes.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Base node, which just configures the "removed" property of the node.
'Neos.Neos:Node':
label: "${String.cropAtWord(String.trim(String.stripTags(String.pregReplace(q(node).property('title') || q(node).property('text') || ((I18n.translate(node.nodeType.label) || node.nodeType.name) + (node.autoCreated ? ' (' + node.name + ')' : '')), '/<br\\W*?\\/?>|\\x{00a0}|[[^:print:]]|\\s+/u', ' '))), 100, '...')}"
label: "${String.cropAtWord(String.trim(String.stripTags(String.pregReplace(q(node).property('title') || q(node).property('text') || ((I18n.translate(node.nodeType.label) || node.nodeType.name) + (node.autoCreated ? ' (' + node.name + ')' : '')), '/<br\\W*?\\/?>|\\x{00a0}|[^[:print:]]|\\s+/u', ' '))), 100, '...')}"
abstract: true
options:
fusion:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</th>
<f:if condition="{contentDimensions}">
<th>
<f:render partial="Module/Shared/NodeContentDimensionsInformation.html" arguments="{contentDimensions: contentDimensions, node: change.node.nodeData}" />
<f:render partial="Module/Shared/NodeContentDimensionsInformation.html" arguments="{contentDimensions: contentDimensions, node: change.node}" />
</th>
</f:if>
<th>
Expand Down

0 comments on commit bc91482

Please sign in to comment.