[BUGFIX] Migrate contentObjectRenderer data only when array
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Mon, 19 Nov 2012 22:52:32 +0000 (23:52 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 20 Nov 2012 18:28:25 +0000 (19:28 +0100)
Passed $data in start method could be a non-array, e.g. in fluid
CObjectViewHelper or in extensions. Migrate $data only if it's a
not empty array and the table is set.

Makes the fieldArray fallback to TSFE->page in getData working again.

Change-Id: I469e8fa6131579a2de399516c65f4822275b187b
Fixes: #43068
Fixes: #43055
Releases: 6.0
Reviewed-on: http://review.typo3.org/16546
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index c16b81e..d7a3afb 100644 (file)
@@ -512,7 +512,9 @@ class ContentObjectRenderer {
         */
        public function start($data, $table = '') {
                global $TYPO3_CONF_VARS;
         */
        public function start($data, $table = '') {
                global $TYPO3_CONF_VARS;
-               \TYPO3\CMS\Core\Resource\Service\FrontendContentAdapterService::modifyDBRow($data, $table);
+               if (is_array($data) && !empty($data) && !empty($table)) {
+                       \TYPO3\CMS\Core\Resource\Service\FrontendContentAdapterService::modifyDBRow($data, $table);
+               }
                $this->data = $data;
                $this->table = $table;
                $this->currentRecord = $table ? $table . ':' . $this->data['uid'] : '';
                $this->data = $data;
                $this->table = $table;
                $this->currentRecord = $table ? $table . ':' . $this->data['uid'] : '';