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

Ensure null values are not passed to trim() #2889

Merged

Conversation

mattdavenport
Copy link
Contributor

As Magento allows eav attributes without a backing table (backend_table in the DB), we should ensure that those null values are passable into the trim function. I noticed @sreichel used a string typecast in the larger #2586 PR , so I'm going with that same convention. Alternatively a null coalesce could be used here if that is preferred. This fixes the deprecation notice in PHP 8.1.

@github-actions github-actions bot added the Component: Eav Relates to Mage_Eav label Jan 3, 2023
@sreichel
Copy link
Contributor

sreichel commented Jan 3, 2023

I noticed @sreichel used a string typecast in the larger #2586 PR

Its not my PR, but LGTM ;)

@mattdavenport
Copy link
Contributor Author

Wrong tag @sreichel, my apologies! I was just looking at another 8.1 issue you were fixing 😛

Given that we may have attributes without a backend_table defined (null
value), safely pass this value into the trim function.
@mattdavenport mattdavenport force-pushed the fix/php8.1/backend-table-null-dep branch from d430ea4 to e0e9744 Compare January 3, 2023 21:01
@fballiano fballiano merged commit 4ed0391 into OpenMage:1.9.4.x Jan 3, 2023
@sreichel sreichel added the PHP 8.1 Related to PHP 8.1 label Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Eav Relates to Mage_Eav PHP 8.1 Related to PHP 8.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants