Project

General

Profile

Actions

Bug #49056

closed

Call stdWrapPostProcess hook even if "if" returned FALSE

Added by Reinhard Führicht over 11 years ago. Updated almost 5 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2013-06-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I use the stdWrap hooks in Formhandler to add and remove submitted form values to $_GET/$_POST.

I use stdWrapPreProcess to add them and stdWrapPostProcess to remove them.

Problem:

If the user adds and "if" somewhere to the TypoScript, the stdWrapPostProcess method isn't called and the values can't be removed again.

e.g.:

markers {
    test = TEXT
    test {
        value = test
        if.isTrue.data = GP:debug
    }
}

I found out, that an "if" evaluating to FALSE sets a "stopRendering" flag.
It would be nice to call at least stdWrapPostProcessing in any case.

I would like to know if that would be acceptable before pushing something to Gerrit.

Here are the suggested changes:

diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
index de341f5..f554898 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
@@ -2019,6 +2019,13 @@ class ContentObjectRenderer {
                                                $isExecuted[$functionName] = TRUE;
                                                $isExecuted[$functionProperties] = TRUE;
                                        }
+                               } elseif($this->stopRendering[$this->stdWrapRecursionLevel]) {
+                                       // Hand over the whole $conf array to the stdWrapHookObjects
+                                       if ($functionType === 'hook') {
+                                               $singleConf = $conf;
+                                       }
+                                       $functionName = 'stdWrap_stdWrapPostProcess';
+                                       $content = $this->{$functionName}($content, $singleConf);
                                }
                        }
                        unset($this->stopRendering[$this->stdWrapRecursionLevel]);
Actions

Also available in: Atom PDF