Bug #66855

Format/HtmlViewHelper don't render Links in TYPO3_MODE = BE

Added by Carsten Biebricher over 4 years ago. Updated over 2 years ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2015-05-08
Due date:
% Done:

0%

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

Description

When I use the HtmlViewHelper in the BackendEnviroment (in my case to send emails with the scheduler) links aren't be rendered with the HtmlViewHelper. In fact they were removed from the HTML.

After some debugging it points out, that the function simulateFrontendEnvironment in the HtmlViewHelper were different to the function of the \TYPO3\CMS\Extbase\Utility\FrontendSimulatorUtility::simulateFrontendEnvironment especially in the point with the $GLOBALS['TSFE']->cObjectDepthCounter.

When set the cObjectDepthCounter in the HtmlViewHelper all links will be rendered in the right way.

Not setting the cObjectDepthCounter will result in the early exit in /typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php on line 718.


714    public function cObjGetSingle($name, $conf, $TSkey = '__') {
715        global $TYPO3_CONF_VARS;
716        $content = '';
717        // Checking that the function is not called eternally. This is done by interrupting at a depth of 100
718        $GLOBALS['TSFE']->cObjectDepthCounter--;
719        if ($GLOBALS['TSFE']->cObjectDepthCounter > 0) {

I have created two different patches.
Patch one use the \TYPO3\CMS\Extbase\Utility\FrontendSimulatorUtility::simulateFrontendEnvironment
Patch two set the cObjectDepthCounter by its own

This problem may occure in other BackendEnviroment situations with simulated Frontend Enviroments.

HtmlViewHelper.Extbase.patch View - Patch one :: use Extbase (1.29 KB) Carsten Biebricher, 2015-05-08 14:50

HtmlViewHelper.Inline.patch View - Patch two :: set cObjectDepthCounter inline (589 Bytes) Carsten Biebricher, 2015-05-08 14:50


Related issues

Related to TYPO3 Core - Bug #67556: System news cannot render RTE content Under Review 2015-06-17
Related to TYPO3 Core - Story #73183: Removal of frontend simulation in all ViewHelpers Under Review 2016-02-08
Duplicated by TYPO3 Core - Bug #75219: Link tag is not rendered in entries sys_news on TYPO3 login page Closed 2016-03-22

History

#1 Updated by Gerrit Code Review about 4 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40352

#2 Updated by Claus Due almost 4 years ago

I recommend closing this one, but I refrain from rejecting it outright - will comment in #67556 about suggested solution.

#3 Updated by Wouter Wolters over 3 years ago

  • Status changed from Under Review to Closed

I'm closing this one to keep all information in one ticket. Please continue in https://forge.typo3.org/issues/67556

#4 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Closed to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48580

#5 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48580

#6 Updated by Gerrit Code Review over 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48580

#7 Updated by Gerrit Code Review almost 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48580

#8 Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48580

Also available in: Atom PDF