Created
October 31, 2013 14:41
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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