"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Neos.ContentRepository/Classes/Domain/Model/Node.php" between
neos-development-collection-7.0.0.tar.gz and neos-development-collection-7.0.1.tar.gz

About: TYPO3 Neos is a Content Application Platform with a CMS and an application framework at its core (based on the PHP web application platform "FLOW3").

Node.php  (neos-development-collection-7.0.0):Node.php  (neos-development-collection-7.0.1)
skipping to change at line 1665 skipping to change at line 1665
* @throws NodeTypeNotFoundException * @throws NodeTypeNotFoundException
*/ */
protected function createRecursiveCopy(NodeInterface $referenceNode, string $nodeName, bool $detachedCopy): NodeInterface protected function createRecursiveCopy(NodeInterface $referenceNode, string $nodeName, bool $detachedCopy): NodeInterface
{ {
$identifier = null; $identifier = null;
$referenceNodeDimensions = $referenceNode->getDimensions(); $referenceNodeDimensions = $referenceNode->getDimensions();
$referenceNodeDimensionsHash = Utility::sortDimensionValueArrayAndReturn DimensionsHash($referenceNodeDimensions); $referenceNodeDimensionsHash = Utility::sortDimensionValueArrayAndReturn DimensionsHash($referenceNodeDimensions);
$thisDimensions = $this->getDimensions(); $thisDimensions = $this->getDimensions();
$thisNodeDimensionsHash = Utility::sortDimensionValueArrayAndReturnDimen sionsHash($thisDimensions); $thisNodeDimensionsHash = Utility::sortDimensionValueArrayAndReturnDimen sionsHash($thisDimensions);
if ($detachedCopy === false && $referenceNodeDimensionsHash !== $thisNod
eDimensionsHash && $referenceNode->getContext()->getNodeByIdentifier($this->getI // We are only allowed to re-use the node's identifier if the copy-targe
dentifier()) === null) { t's context (from $referenceNode)
// does NOT contain this identifier.
// We need to check this also taking removed and invisible nodes into ac
count.
//
// Without changing the context, removedContentShown is typically FALSE,
leading to the FOLLOWING BUG:
//
// PREREQUISITES:
// - a language dimension with two values, without fallbacks ("de" and "
en")
// - create a page in DE with content nodes "text1" and "text2"
// - translate this page to EN and let it copy all content. "text1" also
exists on EN now, and has the same identifier as in DE.
// - publish everything.
//
// REPRODUCING THE BUG: (comment out the removedContentShown line below)
// - select "text1" in "DE" and copy it
// - switch to EN
// - REMOVE the node "text1" in EN
// - PASTE the node from the clipboard AFTER text2 (in EN).
// - (this triggers the code we have here.)
//
// EXPECTED BEHAVIOR
// - the pasted node is shown
//
// ACTUAL BEHAVIOR
// - the pasted node is not shown, but is still in the database.
// - it can happen that the node *is* shown, if it is inserted above the
removed node. Still, we have an invariant violation nevertheless.
// - this can also trigger problems when **publishing** the not-rendered
-anymore-node (UniqueConstraint errors in the database) - this is
// how we actually found the error.
$contextPropertiesWithAllNodesShown = $referenceNode->getContext()->getP
roperties();
$contextPropertiesWithAllNodesShown['invisibleContentShown'] = true;
$contextPropertiesWithAllNodesShown['removedContentShown'] = true;
$contextPropertiesWithAllNodesShown['inaccessibleContentShown'] = true;
$referenceNodeContextWithAllNodesShown = $this->contextFactory->create($
contextPropertiesWithAllNodesShown);
if ($detachedCopy === false && $referenceNodeDimensionsHash !== $thisNod
eDimensionsHash && $referenceNodeContextWithAllNodesShown->getNodeByIdentifier($
this->getIdentifier()) === null) {
// If the target dimensions are different than this one, and there i s no node shadowing this one in the target dimension yet, we use the same // If the target dimensions are different than this one, and there i s no node shadowing this one in the target dimension yet, we use the same
// node identifier, effectively creating a new node variant. // node identifier, effectively creating a new node variant.
$identifier = $this->getIdentifier(); $identifier = $this->getIdentifier();
} }
$copiedNode = $referenceNode->createSingleNode($nodeName, null, $identif ier); $copiedNode = $referenceNode->createSingleNode($nodeName, null, $identif ier);
if ($copiedNode instanceof Node) { if ($copiedNode instanceof Node) {
$copiedNode->similarize($this, true); $copiedNode->similarize($this, true);
} }
 End of changes. 1 change blocks. 
3 lines changed or deleted 45 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)