Project

General

Profile

Actions

Feature #90225

closed

Fluid Value Extraction

Added by Frank Fischer about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2020-01-28
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.2
Tags:
Complexity:
no-brainer
Sprint Focus:

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.

Actions #1

Updated by Frank Fischer about 4 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by Frank Fischer about 4 years ago

  • Subject changed from Fluid Valiue Extraction to Fluid Value Extraction
Actions #3

Updated by Claus Due about 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.

Actions

Also available in: Atom PDF