Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Do proper resolving of FusionPathProxy #3358

Conversation

kdambekalns
Copy link
Member

Using {image.title} in Fluid when the image is a FusionPathProxy does not work. The result is simply null instead of the image title.

This change fixes that by moving more code down into our own custom TemplateVariableContainer from the StandardVariableProvider.

Fixes #3357

Review instructions

The fixed issue contains instructions on how to reproduce this.

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

Using `{image.title}` in Fluid when the image is a `FusionPathProxy`
does not work. The result is simply `null` instead of the image title.

This change fixes that by moving more code down into our own custom
`TemplateVariableContainer` from the `StandardVariableProvider`.

Fixes neos#3357

/**
* Provides the variables inside fluid template. Adds TemplateObjectAccessInterface functionality.
*
* @api
*/
class TemplateVariableContainer extends StandardVariableProvider implements VariableProviderInterface
class TemplateVariableContainer extends StandardVariableProvider
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface is implemented by the extended class already…

$subject = $subject->$isMethod();
continue;
}
$hasMethod = 'has' . $upperCasePropertyName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth a consideration to use object access here?
And also can it be that we lost certain features over time in fluid like #108?
I cant really judge and am not that invested into it and neither know whats best. But it seems its a bit back and forth ... we seemed to had already such manual implementation once and it got lost it seems?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did very consciously copy the method as unchanged as possible, to make the difference clearly visible and easy to understand. This will make maintenance easier for our future selves.

About #108 – yes, it seems that was lost. But given the decline of Fluid, I have little interest in fixing that nowish, and certainly not in the scope of this PR…

@dlubitz
Copy link
Contributor

dlubitz commented May 26, 2024

Looks reasonable to me.

@kdambekalns kdambekalns merged commit b4292e4 into neos:9.0 Jun 6, 2024
7 checks passed
@kdambekalns kdambekalns deleted the bugfx/3357-templatevariablecontainer-vs-fusionpathproxy branch June 6, 2024 15:09
robertlemke added a commit that referenced this pull request Jun 14, 2024
Flow 8.x only works correctly with typo3fluid 2.7.x - see: #3038, #3041 and #3358
robertlemke added a commit that referenced this pull request Jun 14, 2024
Flow 8.x only works correctly with typo3fluid 2.7.x - see: #3038, #3041 and #3358
neos-bot pushed a commit to neos/flow that referenced this pull request Jun 14, 2024
neos-bot pushed a commit to neos/fluidadaptor that referenced this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Fluid does not correctly resolve path references on FusionPathProxy
3 participants