[BUGFIX] Chained stdWrap is broken for boolean stdWrap function types
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 15 Jul 2011 12:52:33 +0000 (14:52 +0200)
committerXavier Perseguers <typo3@perseguers.ch>
Sun, 24 Jul 2011 10:19:07 +0000 (12:19 +0200)
isExecuted was not correctly set and so stdWrap was
actually called twice.

Thanks to Jo Hasenau.

Change-Id: If35c3bb3572265109207d3835135d9cc5d487a0a
Resolves: #28234
Releases: 4.5, 4.6
Reviewed-on: http://review.typo3.org/3355
Reviewed-by: Jo Hasenau
Tested-by: Jo Hasenau
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/cms/tslib/class.tslib_content.php

index f06824c..0edddbc 100644 (file)
@@ -1854,7 +1854,7 @@ class tslib_cObj {
                                        }
                                        // check if key is still containing something, since it might have been changed by next level stdWrap before
                                        if ((isset($conf[$functionName]) || $conf[$functionProperties]) &&
-                                                       !($functionType == 'boolean' && $conf[$functionName] === '0')) {
+                                                       !($functionType == 'boolean' && !$conf[$functionName])) {
                                                //add both keys - with and without the dot - to the set of executed functions
                                                $isExecuted[$functionName] = TRUE;
                                                $isExecuted[$functionProperties] = TRUE;
@@ -1864,6 +1864,10 @@ class tslib_cObj {
                                                        $content,
                                                        $singleConf
                                                );
+                                       // for booleans we have to mark the function as executed in any case, even if it has been 0, '' or false to avoid a second call based on the functionProperties, which would always be true
+                                       } elseif($functionType == 'boolean' && !$conf[$functionName]) {
+                                               $isExecuted[$functionName] = TRUE;
+                                               $isExecuted[$functionProperties] = TRUE;
                                        }
                                }
                        }