56951[TASK] Use optimal strategy to disable Fluid debug
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 12
- typo3/sysext/adminpanel/Classes/View/AdminPanelView.php2+9 −0
- typo3/sysext/adminpanel/Resources/Private/Partials/Modules/Preview/ShowHiddenElements.html+4 −4
- typo3/sysext/adminpanel/Resources/Private/Templates/Modules/Cache.html+4 −4
- typo3/sysext/adminpanel/Resources/Private/Templates/Modules/Edit.html+3 −3
- typo3/sysext/adminpanel/Resources/Private/Templates/Modules/Info.html+8 −8
- typo3/sysext/adminpanel/Resources/Private/Templates/Modules/Preview.html+3 −3
- typo3/sysext/adminpanel/Resources/Private/Templates/Modules/TsDebug.html+7 −7
- typo3/sysext/core/Documentation/Changelog/9.2/Feature-84216-FluidPartialDebugOutputShouldNotBeVisibleInAdminPanel.rstdeleted+0 −21
- typo3/sysext/fluid/Classes/Core/ViewHelper/ViewHelperResolver.php+3 −1
- typo3/sysext/fluid/Classes/ViewHelpers/Debug/RenderViewHelper.php+0 −7
- typo3/sysext/fluid/Classes/ViewHelpers/RenderViewHelper.phpdeleted+0 −30
- typo3/sysext/fluid/Tests/Unit/Core/ViewHelper/ViewHelperResolverTest.php+2 −1
Review log 4453
Show 2228 earlier messages
-
Claus Due uploaded patch set 1 05/12/18, 21:57
-
Claus Due commented on patch set 1 05/12/18, 22:02
Patch f63c4fe80529315b319be7127192fdf344177bce can be reverted after this is merged. -
Claus Due commented on patch set 1 05/12/18, 22:03
Patch f17c6250bb37c76bc87d82ee04f117393dab7332 can be reverted as well after this is merged. -
TYPO3com voted on patch set 1 V +1 05/12/18, 22:06 Completed build in 09m 00s on Sun, 13 May, 12:06 AM Test Summary: 31114 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23412
-
Claus Due updated the commit message in patch set 2 05/12/18, 22:07
-
Claus Due uploaded patch set 3 05/12/18, 22:13
-
TYPO3com voted on patch set 3 V -1 05/12/18, 22:13 Completed build in 08s on Sun, 13 May, 12:13 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23416
-
TYPO3com voted on patch set 2 V +1 05/12/18, 22:15 Completed build in 07m 49s on Sun, 13 May, 12:15 AM Test Summary: 31114 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23415
-
Claus Due commented on patch set 3 05/12/18, 22:17
PS3: Change UC instead of configuration array as ViewHelperResolver constructor is reading UC and adding namespace based on that. Possible alternative could be a (static/global) toggle on our ViewHelperResolver implementation which we can change similarly to changing UC. I can of course refactor to do that instead, if this is preferable. It would allow debugging to be prevented in other places as well, maybe that is reason enough to do it that way instead? -
Oliver Klee updated the commit message in patch set 4 05/13/18, 10:39
-
TYPO3com voted on patch set 4 V -1 05/13/18, 10:39 Completed build in 06s on Sun, 13 May, 12:39 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23427
-
Christian Kuhn uploaded patch set 5 05/13/18, 21:35
-
Christian Kuhn commented on patch set 5 05/13/18, 21:35
cgl fix only to make bamboo happy. -
TYPO3com voted on patch set 5 V +1 05/13/18, 21:43 Completed build in 07m 50s on Sun, 13 May, 11:43 PM Test Summary: 31180 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23459
-
Helmut Hummel commented on patch set 5 05/14/18, 08:29
I think that is much better than introducing a new subclass of debug view helper, but still not quite what I imagined. I'd rather change the variable container in rendering context for the rendering of the admin panel (and of course then remove the subclass again and adapt the templates accordingly) -
Claus Due commented on patch set 5 05/14/18, 08:57
@Helmut I can understand why you would prefer that, but it is not possible to achieve through that route. The variable container is not a singleton and will be created fresh for every sub-view. -
Helmut Hummel uploaded patch set 6 05/14/18, 09:00
-
Helmut Hummel commented on patch set 6 05/14/18, 09:02
something along those lines. disabling the debugging in the view. I'd prefer a template instruction (like disabling escaping), but have no time to work on that right now -
Claus Due commented on patch set 6 05/14/18, 09:05
I don't like this variant. * Adds new public API for the View - one of our sub-goals is to try to move away from our views and in particular the StandaloneView. * Adds constructor argument to a Fluid subclass, which means it can't be compatible if a constructor argument is ever added to that class in Fluid. * Flushes the instance which may already be configured - using this after you've set a namespace will kill that namespace. Template modifier? Perhaps, but that's still opt-in from the template level and as such not really an improvement on the debug="false" thing except it avoids adding a VH override. -
TYPO3com voted on patch set 6 V +1 05/14/18, 09:10 Completed build in 10m 33s on Mon, 14 May, 11:10 AM Test Summary: 31180 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23473
-
Helmut Hummel commented on patch set 6 05/14/18, 09:24
> The variable container is not a singleton and will be created fresh for every sub-view. can you elaborate where exactly? -
Claus Due commented on patch set 6 05/14/18, 09:29
https://github.com/TYPO3/Fluid/blob/master/src/Core/Rendering/RenderingContext.php#L142 All of the second-level utility API classes are created here. The rendering context is created quite early (same time as view) and then gets used throughout that template rendering. If any VH renders a sub-view, that gets a new rendering context which would then also need to disable debugging. This would include any views that get rendered via hooks so it's not ideal, imho. A template pre-processor has the same limitation. Furthermore, that comes with the danger that unless the pre-processing happens in exactly the right order (debug-off coming before namespace) calling that method would destroy namespaces declared with {namespace} syntax, both ignored and real ones. This is, as far as I can predict it, why we need to do this at a more global level than making it opt-in for templates that get rendered here (ours and third party ones). -
Helmut Hummel commented on patch set 6 05/14/18, 09:30
> I don't like this variant. Well. You don't want to disable it on template level, but also don't want public PHP API? Not much left, isn't it? I'm not insisting on the proposed implementation, but we must decide where to put it. Modifying global state shouldn't be the final solution. -
Claus Due commented on patch set 6 05/14/18, 09:31
> Not much left, isn't it? Not much, no. Except for the less pretty solutions - like modifying the UC temporarily. -
Helmut Hummel commented on patch set 6 05/14/18, 10:03
OK, thanks. Get your point. I still dislike: * ViewHelperResolver depends on (is coupled with) backend, frontend, adminpanel * Modifying global state, in particular modifying UC > one of our sub-goals is to try to move away from our views and in particular the StandaloneView Can you elaborate on that? The main difference between native Fluid views and our implementations is controller context. While I get why we want to move away from the current StandaloneView implementation, I don't see how we can ever have a view without controller context (without loosing quite some features) -
Claus Due commented on patch set 6 05/14/18, 10:36
> Can you elaborate on that? The main difference between native Fluid views and our implementations is controller context. While I get why we want to move away from the current StandaloneView implementation, I don't see how we can ever have a view without controller context (without loosing quite some features) Just so everyone can follow it: the original reason for having StandaloneView is it would function without a controller context and by file name/reference alone. Since then, the Views have been unified a bit and both types now provide the same functionality - so it makes a lot of sense to get rid of StandaloneView. This leaves TemplateView, which exists for a couple of reasons: * Like Helmut said, it carries a controller context around * In addition to this, it adds a couple of public API methods (which are basically just shortcuts to identical API on the second-level utility API classes like VariableProvider). * We implement our special RenderingContext through the View * The obvious one: for compatibility reasons. The Views aren't drop-in compatible for the above reasons. There are however ways to transfer objects in exactly the way that's desired here, and it is possible to do with existing public API (disregarding API added by CMS). One way is to override the RenderingContext which we do now - this can then be overridden when creating a View (and this doesn't have to be a custom View class since get and set rendering context is public - albeit not declared on ViewInterface!). I am *not* proposing to get rid of RenderingContext - which is exactly where we store the controller context. So even if that part isn't a problem, if we remove all of our View implementations, that still leaves the "problems" about 1) not having a View constructor and 2) not having the same public API methods. The ways I'd suggest to work with this: * To solve 1), we could use a factory method that is always responsible for creating our Views. Or we could add the required init to places that currently use the View and cover nearly all use cases: FLUIDTEMPLATE and Extbase MVC. Or both (my suggestion would be both). * To solve 2) we are unfortunately looking at a rather breaking change, but only for quite advanced usages of internal API (like, forcing template paths without regard to the logic that resolves it using TS and context by using ->setPartialRootPaths etc. on View). And the very long term aspects: * Given enough time to adapt to Fluid and Fluid becoming more advanced, and given a possible refactoring to a factory method for Views, it is very likely that we can remove even our RenderingContext override - which would be an extremely nice move in terms of making templates render exactly like standalone Fluid does. * If and when we remove our RenderingContext, your concern about the controller context becomes relevant. There is one nice solution to that: store a reference to the ControllerContext (possibly also Request for convenience?) in ViewHelperVariableContainer from where it can be extracted at any point in the recursive rendering process that applies to that View. Since we'd theoretically have a factory method, we can consistently apply this VH variable. While you (Helmut) are correct that it implies a loss of features (proxy public API on View) it's not in the way you feared. It is, however, ultimately the removal of all of our public API overrides for Fluid - making the CMS implementation 100% Fluid compliant with no overrides required, purely integrated via proper context construction. It's not exactly around the corner but this should explain why I prefer the choices that avoid new public API and keep our classes fully compatible (signature-wise) with the ones they subclass! -
Helmut Hummel uploaded patch set 7 05/14/18, 11:29
-
Helmut Hummel commented on patch set 7 05/14/18, 11:31
> Just so everyone can follow it Thanks a lot. I think I can follow, would have some points to discuss, but this would lead to far for this change of course. We should have a Fluid initiative code sprint to discuss that (and start implementing improvements)
-
TYPO3com voted on patch set 7 V -1 05/14/18, 11:37 Completed build in 07m 42s on Mon, 14 May, 01:37 PM Test Summary: 3 of 31427 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23480
-
Helmut Hummel uploaded patch set 8 05/14/18, 14:04
-
TYPO3com voted on patch set 8 V +1 05/14/18, 14:14 Completed build in 09m 59s on Mon, 14 May, 04:14 PM Test Summary: 31184 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23484
-
Mathias Schreiber commented on patch set 8 05/14/18, 16:11
since we delete a feature introduced earlier, would this need !!! and Breaking RST? -
Claus Due commented on patch set 8 05/14/18, 16:15
@Mathias is that also required if instead, the old patches were reverted (thus removing the RST etc.)? -
Mathias Schreiber commented on patch set 8 05/14/18, 16:20
my reasoning is not about revert or not. Deleting API (which technically is what we're doing here) needs to be marked as breaking. People might rely on the functionality being there. Furthermore I don't really want to spoil the party here, but having the chance to explicitly except single templates from the debug output is VERY useful to me and IMO does not only apply to the adminPanel. While I get what you try to achieve, it just fixes a very narrow scenario. -
Helmut Hummel commented on patch set 8 05/14/18, 22:59
> would this need !!! and Breaking RST? most likely, yes -
Helmut Hummel commented on patch set 8 05/14/18, 23:08
> Furthermore I don't really want to spoil the party here Honestly, the party did not happen here, but here: https://review.typo3.org/#/c/56173/ What Claus thankfully started and where I chimed in, is cleaning up after the party ;) SCNR Anyway, I won't complain about this feature being rushed in and I understand the importance of it as it was a critical bugfix for the new admin panel. Nevertheless, the issue with such rushed in features is, that there is no time to think much about implementation, impact, usefulness, let alone user stories. > having the chance to explicitly except single templates from the debug output is VERY useful to me and IMO does not only apply to the adminPanel Looking at the related forge ticket: https://forge.typo3.org/issues/84216 there is no information about that, therefore I concentrated on improving the implementation to cover the use case we have and therefore remove the previous implementation. Now you come up with a different use case and covering that would require agreement on a user stories (what exactly would we want to allow for developers and/or integrators) a concept and of course some implementation different to what is proposed here. But yeah, I also thought about something that could be useful along these lines. What I would find useful is: * Letting developers ENABLE Fluid debug output per rendered plugin/template, despite admin panel settings * Letting developers DISABLE Fluid debug per rendered plugin/template despite admin panel settings What we get with the (here to be reverted) feature: * No way to enable debug output <f:render partial="foo" debug="true" /> has no effect * Possibility to DISABLE debug per partial/section There might be some use case for that except admin panel, e.g. putting that everywhere in your main templates, to be able to better see debug output of third party plugins, but I personally would not be willing to accept the overhead. People have all kind of workflow preferences (https://xkcd.com/1172/), but I would say there is room for improvement That said, I'll hand over the decision to the team, whether to keep this feature or not and will abstain from further involvement here. -
Helmut Hummel wrote 05/14/18, 23:14
Removed reviewer Helmut Hummel. -
Claus Due commented on patch set 8 05/14/18, 23:42
Collecting the use case stories, here's a solution that uses native Fluid API to get the job done and supports all of the desired use cases. The one case it doesn't support is per-usage debugging of f:render as it would enable or disable this for an entire template at a time: We create a DebugTemplatePreProcessor which can catch either {debug off} or {debug on} being set in the template, and we make it toggle debugging when no flag is set in the template, based on the current fluid debug toggle. If we want to avoid declaring this in templates for the admin panel, and we want to allow hooks that render fluid template to not care about disabling debugging, we can add a globally accessible way to completely switch debugging off and even ignore if someone attempts to re-enable it in a template that won't support it. It would still be cleaner to not do this via templates - and that's still my recommendation - but if you insist on that being possible, the template pre-processor seems like the right choice. -
Nicole Hummel voted on patch set 8 CR +1 05/15/18, 10:15
-
Claus Due commented on patch set 8 CR -1 05/15/18, 10:55
AdminPanelView.php:297= false. -
Nicole Hummel voted on patch set 8 CR 0 05/15/18, 11:16
-
Nicole Hummel commented on patch set 9 05/15/18, 11:17
Published edit on patch set 8. -
Nicole Hummel voted on patch set 9 CR +1 05/15/18, 11:17
-
TYPO3com voted on patch set 9 V +1 05/15/18, 11:25 Completed build in 08m 36s on Tue, 15 May, 01:25 PM Test Summary: 31187 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-23506
-
Claus Due commented on patch set 9 05/15/18, 11:25
The code looks okay to me, solves the original issue, but: * Does not fulfil the request(?) from Mathis to allow opting out in templates * Would I think still need a new RST, if this feature was ever in any released versions I'll refrain from voting until we hammer those details out. If we need opt-out from templates please check my first comment from today about template pre-processing. -
Helmut Hummel commented on patch set 8 05/15/18, 11:33
AdminPanelView.php:297Replyuh, yeah, sure. thanks -
Helmut Hummel commented on patch set 9 CR -2 05/15/18, 11:49
Claus, thanks again. I think we're now on exactly the same page. I have no idea what is wanted or needed here, thus escalated that to the core team. From my pov, the proposed solution here would suffice for our needs, but of course would require to be marked as breaking as the reverted feature was released with 9.2 I'm blocking it for now until decision is made -
Helmut Hummel wrote 07/23/18, 18:15
Removed reviewer Helmut Hummel with the following votes: * Code-Review-2 by Helmut Hummel <typo3@helhum.io> -
Susi Moog commented on patch set 9 CR -2 09/19/18, 09:55
blocking until after 9 LTS, it's too late for this change atm. -
Susi Moog wrote 10/28/18, 11:59
Removed Code-Review-2 by Susanne Moog <susanne.moog@typo3.org> -
Susi Moog wrote 10/28/18, 12:15
Removed reviewer Susanne Moog. -
Frank Nägler commented on patch set 9 05/31/19, 13:52
no activity on this patch since months, is anyone still working on it? -
Benni Mack abandoned the change 02/27/20, 15:54
I abandon this change for now but keep the issue open, due to lack of feedback. If you want to rebase this one, feel free to re-open this patchset.