Bug #53644

createAndRender() fails to render element added to Carousel

Added by Karsten Dambekalns over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2013-11-14
Priority:Should have Due date:
Assigned To:Christian Müller % Done:

0%

Category:-
Target version:-

Description

The first image element added to a Carousel element is rendered as expected (dummy image). The request sent to callAndRender() is this (edited for clarity):

"data": [
  "/sites/jounal/home/tech/on-the-go/back-to-the-future/main/node52851b1557c8b/carouselItems@user-username", 
  "pageArticle<TYPO3.Neos:Page>/body<TYPO3.TypoScript:Template>/content/main<TYPO3.Neos:PrimaryContent>/journalCommonsArticle<TYPO3.TypoScript:Matcher>/element<Journal.Commons:Article>/main<TYPO3.Neos:ContentCollection>/itemRenderer<TYPO3.Neos:ContentCase>/default<TYPO3.TypoScript:Matcher>/
element<TYPO3.Neos:ContentCollection>/itemRenderer<TYPO3.Neos:ContentCase>/default<TYPO3.TypoScript:Matcher>/element<Journal.Commons:Carousel>/carouselItems<TYPO3.Neos:ContentCollection>",
  {"nodeType": "TYPO3.Neos.NodeTypes:Image", "properties": {}},
  "into" 
]

The second image, regardless of it being added after the existing image or to the Carousel's content collection fails to render and shows an exception:

Failed to render element
pageArticle<TYPO3.Neos:Page>/
body<TYPO3.TypoScript:Template>/
content/
main<TYPO3.Neos:PrimaryContent>/
journalCommonsArticle<TYPO3.TypoScript:Matcher>/
element<Journal.Commons:Article>/
main<TYPO3.Neos:ContentCollection>/
itemRenderer<TYPO3.Neos:ContentCase>/
default<TYPO3.TypoScript:Matcher>/
element<Journal.Commons:Carousel>/
carouselItems<TYPO3.Neos:ContentCollection>/
itemRenderer<TYPO3.Neos:ContentCase>/
default<TYPO3.TypoScript:Matcher>/
element<TYPO3.Neos:ContentCollection>/
itemRenderer<TYPO3.Neos:ContentCase>/
default<TYPO3.TypoScript:Matcher>/
element<TYPO3.Neos.NodeTypes:Image>
$subject must be an object or array, NULL given.

The request sent in that case is this:

"data": [
  "/sites/journal/home/tech/on-the-go/back-to-the-future/main/node52851b1557c8b/carouselItems/node52851b354c080@user-username", 
  "pageArticle<TYPO3.Neos:Page>/body<TYPO3.TypoScript:Template>/content/main<TYPO3.Neos:PrimaryContent>/journalCommonsArticle<TYPO3.TypoScript:Matcher>/element<Journal.Commons:Article>/main<TYPO3.Neos:ContentCollection>/itemRenderer<TYPO3.Neos:ContentCase>/default<TYPO3.TypoScript:Matcher>
/element<Journal.Commons:Carousel>/carouselItems<TYPO3.Neos:ContentCollection>/itemRenderer<TYPO3.Neos:ContentCase>/default<TYPO3.TypoScript:Matcher>/element<TYPO3.Neos.NodeTypes:Image>",
  {"nodeType": "TYPO3.Neos.NodeTypes:Image", "properties": {}},
  "before" 
]

All as expected (into the carouselItems first, then before a node in the carouselItems), except the typoscriptPath argument, which looks really weird.

History

#1 Updated by Christian Müller over 1 year ago

  • Status changed from New to Accepted
  • Assigned To set to Christian Müller

#2 Updated by Aske Ertmann over 1 year ago

  • Project changed from TYPO3.Media to TYPO3.Neos

#3 Updated by Christian Müller over 1 year ago

Quick update here. The problem is that we are a bit optimistic in \TYPO3\Neos\Service\ExtDirect\V1\Controller\NodeController::createAndRenderAction() with the "parent" TypoScript path. We correctly get the parent path there but we falsely assume that it is always the collection, which is not the case. In fact it will be the matcher most of the time. In this case it leads to an error because we try to use the iterator from the collection in rendering the actual element but because we are not rendering the collection at all the iterator is not in the context in this rendering.

I have a working solution but it is not much more future-proof than what we currently have. I guess we need a base NodeType for ContentCollections if we want to have it extensible.

#4 Updated by Christian Müller over 1 year ago

  • Status changed from Accepted to Resolved

Also available in: Atom PDF