[BUGFIX] Allow to render the same TS object twice
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / ContentContentObject.php
index d1b2d46..795afc0 100644 (file)
@@ -47,7 +47,7 @@ class ContentContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractCon
                // If the currentRecord is set, we register, that this record has invoked this function.
                // It's should not be allowed to do this again then!!
                if ($originalRec) {
-                       $GLOBALS['TSFE']->recordRegister[$originalRec]++;
+                       ++$GLOBALS['TSFE']->recordRegister[$originalRec];
                }
                $conf['table'] = isset($conf['table.']) ? trim($this->cObj->stdWrap($conf['table'], $conf['table.'])) : trim($conf['table']);
                $renderObjName = $conf['renderObj'] ?: '<' . $conf['table'];
@@ -148,6 +148,9 @@ class ContentContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractCon
                }
                // Restore
                $GLOBALS['TSFE']->currentRecord = $originalRec;
+               if ($originalRec) {
+                       --$GLOBALS['TSFE']->recordRegister[$originalRec];
+               }
                return $theValue;
        }