Project

General

Profile

Actions

Story #73183

closed

Removal of frontend simulation in all ViewHelpers

Added by Claus Due about 8 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2016-02-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Sprint Focus:

Description

This issue is to remind of and discuss the following opinionated argument:

"No ViewHelpers should themselves simulate any part of the frontend. Instead, they should throw exceptions if detecting an incomplete frontend context (TSFE, etc.)"

The argument goes as follows:

  1. There is no utility currently which allows perfectly simulating the frontend
  2. The only way to simulate the frontend from a ViewHelper is to set up and construct the fake on every execution
  3. Simulation can be very expensive and is only necessary in some use cases
  4. Frontend simulation should be opt-in and a conscious decision from the developer (dev should be in control of it)

Rather than perform obscured frontend simulations each ViewHelper can instead simply verify the environment it needs and throw a special exception if one isn't found, informing the developer to simulate the frontend before he renders his View and tear it down once he is done rendering.

In terms of performance another solution exists. It would be even simpler to assume that a proper frontend is simulated and throw whichever error happens to occur, e.g. "undefined variable", "call to undefined method" etc. and clearly document in each ViewHelper's documentation block (not in code) what it requires of the frontend context. The argument being that we don't necessarily have to carefully handle every conceivable context problem as long as we inform that "this ViewHelper requires a frontend context minimally consisting of a TSFE with a page repository" and expect the developer to know what that implies if he wants to use that ViewHelper in the backend.


Related issues 7 (0 open7 closed)

Related to TYPO3 Core - Bug #71361: fluid link.typolink crashes in Backend with page linksClosed2015-11-06

Actions
Related to TYPO3 Core - Bug #66855: Format/HtmlViewHelper don't render Links in TYPO3_MODE = BEClosed2015-05-08

Actions
Related to TYPO3 Core - Bug #75314: HtmlViewHelper ignores stdwrap hooksClosed2016-03-30

Actions
Related to TYPO3 Core - Bug #73163: RTE in FE does not show available blockstyles at first tryClosed2016-02-06

Actions
Related to TYPO3 Core - Bug #71771: RTE.default.contentCSS is broken in FrontendClosed2015-11-22

Actions
Related to TYPO3 Core - Bug #67556: System news cannot render RTE contentClosed2015-06-17

Actions
Precedes TYPO3 Core - Bug #76489: f:cObject resets other global parameters in fluid_styled_contentClosed2016-06-07

Actions
Actions #1

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from New 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

Actions #2

Updated by Gerrit Code Review almost 8 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

Actions #3

Updated by Gerrit Code Review almost 8 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

Actions #4

Updated by Gerrit Code Review over 7 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

Actions #5

Updated by Gerrit Code Review almost 7 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

Actions #6

Updated by Benni Mack about 4 years ago

  • Status changed from Under Review to Closed

Hey claus,

I'll close this issue for now. See the discussion on Gerrit. Currently working on further extracting logic from cObj so e.g. parseFunc will work, but that's a separate issue then.

Actions

Also available in: Atom PDF