Skip to content

[Process] Fix bug where $this->callback is never null, resulting in bad argument #51478

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

Merged

Conversation

weaverryan
Copy link
Member

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets None
License MIT
Doc PR Not needed

Hi!

Caused by #51068 - by the time $this->getDescriptors() is called, $this->callback is ALWAYS a callable thanks to $this->callback = $this->buildCallback($callback).

Previously, there was a separate hasCallback property that handled this logic. I chose to NOT re-add that because it was only needed in getDescriptors() and that is only called from this one place: easier to pass $hasCallback as an argument.

Caught by the symfony/ux test suite ❤️

Cheers!

@stof
Copy link
Member

stof commented Aug 24, 2023

is there a way to write a test catching this, so that we don't have similar regressions ?

@weaverryan
Copy link
Member Author

Test added 👍

@fabpot fabpot force-pushed the process-fix-pipes-read-support-regression branch from a7f0739 to 95aa236 Compare October 16, 2023 20:23
@fabpot
Copy link
Member

fabpot commented Oct 16, 2023

Thank you @weaverryan.

@fabpot fabpot merged commit 934aea0 into symfony:6.4 Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants