[BUGFIX] Allow to render the same TS object twice 15/27515/3
authorMarkus Klein <klein.t3@mfc-linz.at>
Tue, 19 Nov 2013 17:36:53 +0000 (18:36 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 9 Feb 2014 19:32:42 +0000 (20:32 +0100)
CONTENT/RECORDS elements prevent to render the same object twice.

Resolves: #53768
Resolves: #28745
Releases: 6.2, 6.1, 6.0
Change-Id: I30750f2dc848521999c3734129439d7f6f90aae1
(cherry picked from commit 1b9d3a59f82b290ae16073e1df5f83fa48363db8)
Reviewed-on: https://review.typo3.org/27515
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php
typo3/sysext/frontend/Classes/ContentObject/RecordsContentObject.php

index 9045694..96f7a6e 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']);
                $tablePrefix = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('_', $conf['table'], TRUE);
@@ -150,10 +150,13 @@ class ContentContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractCon
                }
                // Restore
                $GLOBALS['TSFE']->currentRecord = $originalRec;
+               if ($originalRec) {
+                       --$GLOBALS['TSFE']->recordRegister[$originalRec];
+               }
                return $theValue;
        }
 
 }
 
 
-?>
\ No newline at end of file
+?>
index a1a4350..220cb4a 100644 (file)
@@ -47,7 +47,7 @@ class RecordsContentObject 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];
                }
                $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'];
@@ -118,6 +118,9 @@ class RecordsContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractCon
                }
                // Restore
                $GLOBALS['TSFE']->currentRecord = $originalRec;
+               if ($originalRec) {
+                       --$GLOBALS['TSFE']->recordRegister[$originalRec];
+               }
                return $theValue;
        }