[BUGFIX] Add table as parameter to CObjectViewHelper 96/21096/2
authorWouter Wolters <typo3@wouterwolters.nl>
Sun, 12 May 2013 20:17:27 +0000 (22:17 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 8 Oct 2013 23:33:48 +0000 (01:33 +0200)
When passing a tt_content record with an image to the
CObjectViewHelper it doesn't convert the FAL reference with
an image path. To correct this we add an optional parameter
for the table.

Change-Id: I7d045e4e785cf99410ca359eb1011a59ac5cb0fe
Resolves: #47368
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/21096
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Helmut Hummel
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php

index 83adf5f..b8e707e 100644 (file)
@@ -79,10 +79,11 @@ class CObjectViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHel
         * @param string $typoscriptObjectPath the TypoScript setup path of the TypoScript object to render
         * @param mixed $data the data to be used for rendering the cObject. Can be an object, array or string. If this argument is not set, child nodes will be used
         * @param string $currentValueKey
+        * @param string $table
         * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
         * @return string the content of the rendered TypoScript object
         */
-       public function render($typoscriptObjectPath, $data = NULL, $currentValueKey = NULL) {
+       public function render($typoscriptObjectPath, $data = NULL, $currentValueKey = NULL, $table = '') {
                if (TYPO3_MODE === 'BE') {
                        $this->simulateFrontendEnvironment();
                }
@@ -97,7 +98,7 @@ class CObjectViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHel
                        $data = array($data);
                }
                $contentObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
-               $contentObject->start($data);
+               $contentObject->start($data, $table);
                if ($currentValue !== NULL) {
                        $contentObject->setCurrentVal($currentValue);
                } elseif ($currentValueKey !== NULL && isset($data[$currentValueKey])) {