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

AbstractViewHelper::isValidType misses more simple types like int, float #1021

Open
simonschaufi opened this issue Dec 13, 2024 · 8 comments

Comments

@simonschaufi
Copy link
Contributor

When I define an argument as int, it actually tries to load a class named "int" which of course doesn't exist here:

https://github.com/TYPO3/Fluid/blob/main/src/Core/ViewHelper/AbstractViewHelper.php#L361

Instead all simple types should be checked manually without checking if class_exists.

@s2b
Copy link
Contributor

s2b commented Dec 14, 2024

If we would add scalar types here, a lot of templates would break. I don't think that it's a good idea to throw an exception if the user inputs '1' instead of 1.

Can you elaborate what the exact problem is and what you'd like to achieve?

@simonschaufi
Copy link
Contributor Author

The problem is that fluid looks for classes which are simple types which it shouldn't do. '1' will be casted to int actually so this shouldn't be a problem.

@s2b
Copy link
Contributor

s2b commented Dec 14, 2024

So it's just an implementation problem, not user-facing?

@simonschaufi
Copy link
Contributor Author

yes, internally only

@lolli42
Copy link
Member

lolli42 commented Dec 17, 2024

if i understood correctly, the background of this issue was this reported issue/patch: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87424

@simonschaufi
Copy link
Contributor Author

yes, this is where i originally started from and realized the reported issue here.

@s2b
Copy link
Contributor

s2b commented Dec 17, 2024

That's what I had in mind as well, but that's why I asked: The issue is that some input values are not cast correctly. For example, if maxDepth is defined as int, I would expect to get an integer in the ViewHelper. I would not expect to get an exception.

I'd suggest to close this issue and to write a more general issue instead that describes the problem of the Core issue.

@s2b
Copy link
Contributor

s2b commented Dec 17, 2024

Nevermind, sorry. :) I'd suggest creating a separate issue for the casting behavior. This one is fine, though I would not consider it high priority in contrast to the type casting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants