Feature #66727
closedOutput something other than NULL when a lazy-loaded property (like originalResource) is debugged
0%
Description
I've had some confusion with accessing lazy-loaded extbase properties (http://stackoverflow.com/questions/29988411/display-extbase-filereference-with-fluid) until I was reminded that they are lazyloaded. Others too, before https://forum.typo3.org/index.php/t/198281/
Would it be possible for <f:debug> to output an info like "Lazy-Loaded, access directly" when such properties (like originalResource) are accessed?
Updated by Claus Due about 9 years ago
- Category changed from Fluid to Extbase
Moved to Extbase since the DebuggerUtility (used by f:debug) is part of Extbase, not Fluid. Any patch to allow this should be made available there rather than only in Fluid's ViewHelper.
Updated by Christian Eßl about 5 years ago
$originalResource is not lazyloaded in the usual sense you are used to in extbase. In the case of a lazy annotation it would already show a "LazyLoadingProxy" in the var_dump, which makes it much clearer.
$originalResource is initially "null" and only gets its actual value assigned, the first time its getter getOriginalResources() is called.
This makes it really hard to debug the value in the DebuggeryUtility, because internally, the DebuggerUtility ignores any getter methods and access the properties directly via the Reflection API.
- have the change the code of TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder (possibly breaking things)
- or make DebuggerUtility in this specific case call the getter method instead of directly accessing the property. (Then DebuggerUtility would have to "know" about the implementation of a FileReference, which is bad design).
Updated by Stefan Froemken over 1 year ago
- Status changed from New to Closed
Hello,
thank you for reporting that issue.
Calling each getter of an object may produce heavy load. To prevent that, TYPO3 just shows the property values of given object.
I prefer using
<f:debug>{file.originalResource}</f:debug>
instead of just
<f:debug>{file}</f:debug>
That solution will show you the real content
I will close the ticket now. If you feel this is the wrong decision, let me know, and I will re-open it.
Stefan