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

Fix trim deprecation on a special UUID column case where we trim without knowing if it is a string yet #227

Closed
DiegoPino opened this issue Feb 3, 2025 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@DiegoPino
Copy link
Member

What?

Happens at in the AMI Utility Service at

if (empty(trim($row[$haskey])) || !Uuid::isValid(trim($row[$haskey]))) {

Since I (weird) never ever hit that line of code (it is quite an Exception after all the ifs) I need to investigate which CSV shape triggers it, but the fix is easy.

Convert
if (empty(trim($row[$haskey])) || !Uuid::isValid(trim($row[$haskey]))) {

To

if (isset($row[$haskey])) first, then check if its a string, then check the actual validity.

Basically avoid trimming until we know it is a string. I wish PHP had not deprecated trimming NULLs.

@DiegoPino DiegoPino added the bug Something isn't working label Feb 3, 2025
@DiegoPino DiegoPino added this to the 0.9.0 milestone Feb 3, 2025
@DiegoPino DiegoPino self-assigned this Feb 3, 2025
@DiegoPino
Copy link
Member Author

Solved via 448569c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant