Skip to content

Instantly share code, notes, and snippets.

@hlubek
Created October 31, 2013 14:41
Show Gist options
  • Select an option

  • Save hlubek/7250941 to your computer and use it in GitHub Desktop.

Select an option

Save hlubek/7250941 to your computer and use it in GitHub Desktop.
A possible fix for missing node types, but we have problems with the handling of unknown NodeTypes internally.
diff --git a/Classes/TYPO3/Neos/Service/ContentElementWrappingService.php b/Classes/TYPO3/Neos/Service/ContentElementWrappingService.php
index 3b5937f..60f0843 100644
--- a/Classes/TYPO3/Neos/Service/ContentElementWrappingService.php
+++ b/Classes/TYPO3/Neos/Service/ContentElementWrappingService.php
@@ -67,7 +67,12 @@ class ContentElementWrappingService {
* @return \TYPO3\Fluid\Core\ViewHelper\TagBuilder
*/
public function wrapContentObjectAndReturnTagBuilder(\TYPO3\TYPO3CR\Domain\Model\Node $node, $typoscriptPath, $content, $isPage = FALSE) {
- $nodeType = $node->getNodeType();
+
+ try {
+ $nodeType = $node->getNodeType();
+ } catch(\TYPO3\TYPO3CR\Exception\NodeTypeNotFoundException $e) {
+ $nodeType = new \TYPO3\TYPO3CR\Domain\Model\NodeType('unstructured', array(), array());
+ }
$tagBuilder = new \TYPO3\Fluid\Core\ViewHelper\TagBuilder('div');
$tagBuilder->forceClosingTag(TRUE);
diff --git a/Resources/Private/TypoScript/Prototypes/ContentCase.ts2 b/Resources/Private/TypoScript/Prototypes/ContentCase.ts2
index 73409c0..d719aa2 100644
--- a/Resources/Private/TypoScript/Prototypes/ContentCase.ts2
+++ b/Resources/Private/TypoScript/Prototypes/ContentCase.ts2
@@ -7,5 +7,7 @@ prototype(TYPO3.Neos:ContentCase) < prototype(TYPO3.TypoScript:Case) {
@position = 'end'
condition = TRUE
type = ${q(node).property('_nodeType.name')}
+
+ @exceptionHandler = 'TYPO3\\Neos\\TypoScript\\ExceptionHandlers\\NodeWrappingHandler'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment