/** * Validate node's declared position in hierarchy and add errors to the specified array if found * * @param \SimpleXMLElement $node * @param \Magento\Framework\View\Layout\Element $xml * @param array &$errors */ protected function _collectHierarchyErrors($node, $xml, &$errors) { $name = $node->getName(); $refName = $node->getAttribute('type') == $node->getAttribute('parent'); if ($refName) { $refNode = $xml->xpath("/layouts/{$refName}"); if (!$refNode) { $errors[$name][] = "Node '{$refName}', referenced in hierarchy, does not exist"; } } }
/** * Validate node's declared position in hierarchy and add errors to the specified array if found * * @param SimpleXMLElement $node * @param Mage_Core_Model_Layout_Element $xml * @param array &$errors */ protected function _collectHierarchyErrors($node, $xml, &$errors) { $name = $node->getName(); $refName = $node->getAttribute('type') == Mage_Core_Model_Layout_Update::TYPE_FRAGMENT ? $node->getAttribute('owner') : $node->getAttribute('parent'); if ($refName) { $refNode = $xml->xpath("/layouts/{$refName}"); if (!$refNode) { $errors[$name][] = "Node '{$refName}', referenced in hierarchy, does not exist"; } elseif ($refNode[0]->getAttribute('type') == Mage_Core_Model_Layout_Update::TYPE_FRAGMENT) { $errors[$name][] = "Page fragment type '{$refName}', cannot be an ancestor in a hierarchy"; } } }
/** * Validate node's declared position in hierarchy and add errors to the specified array if found * * @param \SimpleXMLElement $node * @param \Magento\Framework\View\Layout\Element $xml * @param array &$errors */ protected function _collectHierarchyErrors($node, $xml, &$errors) { $name = $node->getName(); $refName = $node->getAttribute('type') == $node->getAttribute('parent'); if ($refName) { $refNode = $xml->xpath("/layouts/{$refName}"); if (!$refNode) { if ($refName == 'checkout_cart_configure' || $refName == 'checkout_cart_configurefailed') { $this->markTestIncomplete('MAGETWO-9182'); } $errors[$name][] = "Node '{$refName}', referenced in hierarchy, does not exist"; } } }