Feature #90225
closedFluid Value Extraction
0%
Description
There is a difference in accessor detection (method detectAccessor) between:
TYPO3Fluid\Fluid\Core\Variables\VariableExtractor
and
TYPO3Fluid\Fluid\Core\Variables\StandardVariableProvider
VariableExtractor detects for ACCESSOR_GETTER by is_callable
StandardVariableProvider detects for ACCESSOR_GETTER by method_exists
This leads to inconsistent variable object handling in fluid when object is using magic method __call, which is detected by is_callable but not by method_exists.
I would recommend to switch StandardVariableProvider ACCESSOR_GETTER detection to is_callable as well.
Updated by Frank Fischer almost 5 years ago
- Subject changed from Fluid Valiue Extraction to Fluid Value Extraction
Updated by Claus Due over 4 years ago
- Status changed from New to Closed
https://github.com/TYPO3/Fluid/issues/513 is the most recent iteration of the discussions surrounding magic method support. This issue and issues linked to it describe in abundant detail the problems associated with using "is_callable" instead of "method_exists".
The VariableExtractor is deprecated although it still gets used in 2.x - this will be changed and the VariableExtractor class will be removed. As such, it is the logic in StandardVariableProvider that specifies the intended behavior. A patch to remove any calls to VariableExtractor will be created, also covering the 2.x branches of Fluid. In the 3.x branch the VariableExtractor class is removed. This patch however is specific to the Fluid repository and does not require a forge issue.
Marking this issue as "closed" since the request would require re-introducing an already-abandoned logic. See the linked issue for workaround instructions as well as long-term solution suggestions for TYPO3 CMS to implement. A solution (ArrayAccess) which you can also personally implement, should you have any third-party classes which depend on magic methods.