61084[BUGFIX] Do not rely on TYPO3_MODE for FE/BE checks
Commit message
Review
-
Code review CR +2 Done
- Daniel Goerz +2
- Alexander Schnitzler +1
- Daniel Gorges +1
-
Verified V +2 Done
- Daniel Goerz +2
- Daniel Gorges +1
- TYPO3com +1 CI
Issues 1
Files 2
Review log 1619
-
Benni Mack uploaded patch set 1 06/18/19, 09:53
-
Benni Mack updated the commit message in patch set 2 06/18/19, 09:54
-
TYPO3com voted on patch set 1 V +1 06/18/19, 10:12 Completed build in 18m 38s on Tue, 18 Jun, 12:12 PM Test Summary: 46442 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34414
-
TYPO3com voted on patch set 2 V +1 06/18/19, 10:17 Completed build in 15m 36s on Tue, 18 Jun, 12:17 PM Test Summary: 46442 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34416
-
Helmut Hummel commented on patch set 2 06/18/19, 11:00
AjaxWidgetContextHolder.php:95Unresolvedsame hereCObjectViewHelper.php:103Unresolvedsame hereCObjectViewHelper.php:138same here. maybe provide an API for that? Maybe Environment::isFrontendRequest or something similar -
Benni Mack uploaded patch set 3 06/18/19, 14:46
-
Benni Mack commented on patch set 3 06/18/19, 14:48
CObjectViewHelper.php:138Replyyeah. I thought of adding this to the Context API back then (as Environment is rather focus on the instance and the PHP CGI/env), but was discussed with Olly to add it later, if needed. Environment API could actually be exposed in `typo3/cms-cli` to be "prepared" during build-time as well in the future to find the paths. -
TYPO3com voted on patch set 3 V +1 06/18/19, 15:01 Completed build in 15m 27s on Tue, 18 Jun, 05:01 PM Test Summary: 46442 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34424
-
Benjamin Franzke commented on patch set 3 06/18/19, 15:15
CObjectViewHelper.php:138Reply UnresolvedI agree that this isn't suitable for the Environment API. The information is derived from the request, that means it should be tied *to* the request. Speaking of PSR-7 that API would be a request attribute which would be set by a middleware (or alternatively a utility function that receives a PSR-7 ServerRequestInterface). Current usage will then be: isset($GLOBALS['TYPO3_REQUEST']) && $GLOBALS['TYPO3_REQUEST']->getAttribute('isFrontendRequest', false) Maybe you know what I want: Once we have proper PSR-7 Request context in fluid/viewhelpers we can receive this information without using $GLOBALS. But as we don't have that yet, $GLOBALS['TSFE'] is fine IMO as we can "swap" (temporarily override) that easily when we start with simulating frontend requests. (Same as we would do with $GLOBALS['TYPO3_REQUEST']) -
Daniel Goerz voted on patch set 3 CR +1 06/19/19, 06:13
-
Alexander Schnitzler commented on patch set 3 06/19/19, 07:05
AjaxWidgetContextHolder.php:54What about just ($GLOBALS['TSFE'] ?? null) instanceof TypoScriptFrontendController? I am pretty sure the null coalescing operator is right associative, hence the paranthesis. -
Benni Mack commented on patch set 3 06/19/19, 09:23
AjaxWidgetContextHolder.php:54Reply Unresolvedall fine with me. the original patch worked for me, variant 2 as well, your suggestion too. -
Benni Mack commented on patch set 3 06/19/19, 14:27
FYI. Most places in Core either use if (isset($GLOBALS['TSFE']) && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { or if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { let's use one of these two (I don't mind which ones) for v9.5 - and we can streamline this then for master only separately. -
Alexander Schnitzler commented on patch set 3 06/19/19, 14:28
> Patch Set 3: > > FYI. Most places in Core either use > > if (isset($GLOBALS['TSFE']) && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { > > or > > if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { > > let's use one of these two (I don't mind which ones) for v9.5 - and we can streamline this then for master only separately. Sure, it's really just code beauty and not important at all. :) -
Benni Mack commented on patch set 3 06/19/19, 14:29
haha :) TYPO3 and Code beauty... -
Alexander Schnitzler commented on patch set 3 CR +1 06/21/19, 06:34
Can't verify at the moment as I don't have a project set up with a fluid widget. -
Daniel Gorges voted on patch set 3 V +1 CR +1 06/26/19, 04:14
-
Daniel Goerz voted on patch set 3 V +2 CR +2 06/27/19, 12:23
-
Daniel Goerz merged patch set 4 06/27/19, 12:23
AjaxWidgetContextHolder.php:54Unresolved