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

ComponentReflection::convertType() empty string problem #318

Open
romanbartl opened this issue Nov 28, 2023 · 0 comments
Open

ComponentReflection::convertType() empty string problem #318

romanbartl opened this issue Nov 28, 2023 · 0 comments

Comments

@romanbartl
Copy link

romanbartl commented Nov 28, 2023

Hey there,

When you declare persistent variable of int|null type inside of Control, and in URL coresponding parameter is empty string, than type error occurs. From what I've learnt this error happens in ComponentReflection in castScalar() method when you try to check whether data-loss happens. It seems that this peace of code does not count with nullable persistent parameters. It happens because strict typed comparassion.

I would expect that when there is given an empty string in GET/POST, and declared coresponding persistent variable is nullable, than 'null' should be assigned. If it makes sence.

Tested on version: 3.1.17.

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

1 participant