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

Update validateAttribute for PHP 8.1 #19668

Merged
merged 3 commits into from
Nov 15, 2022
Merged

Conversation

samuelexyz
Copy link
Contributor

In function validateAttribute call_user_func does not control if $value is null

Added control to fix

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues

In function validateAttribute call_user_func does not control if $value is null

Added control to fix
@samdark samdark added the pr:missing usecase It is not clear what is the use case for the pull request. label Nov 13, 2022
@yii-bot
Copy link

yii-bot commented Nov 13, 2022

Thank you for putting effort in the improvement of the Yii framework.
We have reviewed your pull request.

Unfortunately a use case is missing. It is required to get a better understanding of the pull request and helps us to determine the necessity and applicability of the suggested change to the framework.

Could you supply us with a use case please? Please be as detailed as possible and show some code!

Thanks!

This is an automated comment, triggered by adding the label pr:missing usecase.

@samuelexyz
Copy link
Contributor Author

In PHP 8.1 we need to check if argument of a function is not null, when try to generate code with gii throw an error

PHP Deprecated Warning – yii\base\ErrorException
trim(): Passing null to parameter #1 ($string) of type string is deprecated
image

Copy link
Member

@samdark samdark left a comment

Choose a reason for hiding this comment

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

Please add a line for CHANGELOG. Thanks.

@samuelexyz
Copy link
Contributor Author

@samdark Added to Changelog

Thanks

@samdark samdark removed the pr:missing usecase It is not clear what is the use case for the pull request. label Nov 14, 2022
@samdark samdark merged commit d056c7f into yiisoft:master Nov 15, 2022
@samdark
Copy link
Member

samdark commented Nov 15, 2022

Thanks.

@samdark samdark added this to the 2.0.47 milestone Nov 15, 2022
@samdark
Copy link
Member

samdark commented Nov 15, 2022

Hmm... seems it broke existing tests: d056c7f

samdark added a commit that referenced this pull request Nov 15, 2022
@samdark
Copy link
Member

samdark commented Nov 15, 2022

Re-checked and reverted. The error depends on what's in the $this->filter so it's a case specific to Gii and should be fixed there instead.

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

Successfully merging this pull request may close these issues.

4 participants