[BUGFIX] Allow to render the same TS object twice
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / RecordsContentObject.php
index 47d2e6f..d187a7b 100644 (file)
@@ -68,7 +68,7 @@ class RecordsContentObject extends AbstractContentObject {
                // 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];
                }
                $tables = isset($conf['tables.']) ? $this->cObj->stdWrap($conf['tables'], $conf['tables.']) : $conf['tables'];
                $source = isset($conf['source.']) ? $this->cObj->stdWrap($conf['source'], $conf['source.']) : $conf['source'];
@@ -146,6 +146,9 @@ class RecordsContentObject extends AbstractContentObject {
                }
                // Restore
                $GLOBALS['TSFE']->currentRecord = $originalRec;
+               if ($originalRec) {
+                       --$GLOBALS['TSFE']->recordRegister[$originalRec];
+               }
                return $theValue;
        }