Project

General

Profile

Actions

Task #105113

open

Debug viewhelper and debugger utility vardump don't show if property can be accessed by Fluid and don't show get/is/has methods which act as properties for Fluid

Added by Jigal van Hemert 2 months ago. Updated about 2 months ago.

Status:
Accepted
Priority:
Should have
Category:
Extbase
Target version:
-
Start date:
2024-09-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.3
Tags:
Complexity:
easy
Sprint Focus:

Description

Both the debug viewhelper and DebuggerUtility::var_dump() are often used to show which properties of an object can be used.
Fluid accessors can be:
  • public class variables
  • protected/private class variables with a public getter
  • public getters (functions starting with get/is/has) without a corresponding class variable

The latter category can be used for calculated "properties". It is however not clear in the debug output whether properties can be used as Fluid accessor nor which "virtual" properties are available through extra getters.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Feature #102927: Integrator-oriented optimization of the DebugViewHelperNeeds Feedback2024-01-25

Actions
Actions #1

Updated by Garvin Hicking 2 months ago

  • Status changed from New to Needs Feedback

Yes, this is a shortcoming of the internal debugger.

I can whole-heartedly recommend anyone to look into https://extensions.typo3.org/extension/includekrexx

This extension offers a powerful debugger that makes all these getters and properties fully accessible and searchible.

I initially wanted to enhance the core's debugger, but this alternative is so powerful that I would feel ashamed to rebuild something which is already being well-maintained and fosters the TYPO3 extension ecosystem. I was not aware of it earlier, and maybe this helps in promoting it.

(You can use the extension with a require-dev dependency)

What do you think?

Actions #2

Updated by Garvin Hicking 2 months ago

  • Related to Feature #102927: Integrator-oriented optimization of the DebugViewHelper added
Actions #3

Updated by Jigal van Hemert about 2 months ago

Garvin Hicking wrote in #note-1:

I can whole-heartedly recommend anyone to look into https://extensions.typo3.org/extension/includekrexx
What do you think?

The extension you mention is just a bit powerful and overwhelming for most people. I haven't tried it but the screenshots in the manual looked quite complicated.
I've already made an implementation for the change I propose in this issue. It's quite small and simple, yet it provides the much needed information.

The TYPO3 core should provide a basic set of tools with which you can build a website. There will always be better/alternative extensions to provide a search functionality, forms, and so on. The basic tools should provide enough functionality to be useful and in this case the missing information about available Fluid accessors is in my opinion an omission.

Actions #4

Updated by Garvin Hicking about 2 months ago

Actually it is really a drop-in replacement. You can require-dev it and then just use <krexx:debug>{_all}</krexx:debug> in a fluid partial without further configuration.

I fully agree it would be awesome to have something like it in the TYPO3 core. But you can see in this extension the massive amount of complexity this can have. I tried implementing a "simpler" approach in the core (see the linked issue) but quickly saw there are so many edge cases that need addressing. I would feel really bad to reinvent the wheel and spent hours and hours of implementing something that will not have the functionality this extension provides.

A strength of TYPO3 IMO is that we have an extension ecosystem, and this is really a great example where we might want to rely on functionality like this instead. I understand though that people want to "just work with the core", this is very valid.

We need to decide though if we close this issue in favor of #102927 which is basically the same?

Actions #5

Updated by Benni Mack about 2 months ago

  • Tracker changed from Bug to Task

I wouldn't say this is a bug, rather a task to also see the has-/get methods, maybe there is a "getCalculatedPublishDate" which could be used in Fluid, so we should extend the debug method here.

Actions #6

Updated by Benni Mack about 2 months ago

  • Status changed from Needs Feedback to Accepted
Actions

Also available in: Atom PDF