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

[11.x] Fix handling empty values passed to enum_value() function instead of only empty string #53181

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

crynobone
Copy link
Member

fixes #53180

only empty string

fixes #53180

Signed-off-by: Mior Muhammad Zaki <[email protected]>
@crynobone crynobone marked this pull request as ready for review October 16, 2024 02:35
@crynobone crynobone changed the title [11.x] Handle empty values passed to enum_value() function instead of only empty string [11.x] Fix handling empty values passed to enum_value() function instead of only empty string Oct 16, 2024
Signed-off-by: Mior Muhammad Zaki <[email protected]>
@devajmeireles
Copy link
Contributor

@crynobone Do you believe it will fix Js::from function?

11.27
Illuminate\Support\Js::from([]) => []

11.28
Illuminate\Support\Js::from([]) => null

@crynobone
Copy link
Member Author

@devajmeireles did you check the tests in this PR? Feel free to add more if you see it missing anything

@taylorotwell taylorotwell merged commit c31b2f5 into 11.x Oct 16, 2024
32 checks passed
@taylorotwell taylorotwell deleted the fixes-53180 branch October 16, 2024 16:25
@devajmeireles
Copy link
Contributor

@devajmeireles did you check the tests in this PR? Feel free to add more if you see it missing anything

I'm so sorry! I didn't see the Js::from test.

@PHLAK
Copy link
Contributor

PHLAK commented Oct 17, 2024

This is still broken when an empty collection is passed into Js::from().

Js::from(Collection::make()); // null

This is specifically affecting eloquent query results for me.

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