Skip to content

Conversation

@CreareWorks
Copy link

This fixes a fatal error (Call to undefined method Closure::getClosure()) when a Closure is placed immediately after a Bus::batch call within a Bus::chain.

The issue arose because the Closure object was passed as a raw \Closure instance to CallQueuedClosure::displayName, which incorrectly assumed it was always wrapped in a SerializableClosure and tried to call getClosure().

This patch adds a check to safely extract the underlying Closure, preventing the crash.

Fixes #57597

@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@CreareWorks CreareWorks force-pushed the fix/57597-batch-closure-chain-fix branch 3 times, most recently from 4c5cae9 to 77ca4d0 Compare November 24, 2025 12:53
@CreareWorks CreareWorks force-pushed the fix/57597-batch-closure-chain-fix branch from 77ca4d0 to a5bdd42 Compare November 24, 2025 14:44
@CreareWorks CreareWorks reopened this Nov 24, 2025
@CreareWorks CreareWorks changed the title [12.x] Fix CallQueuedClosure::displayName after batch chain (#57597) Draft:[12.x] Fix CallQueuedClosure::displayName after batch chain (#57597) Nov 24, 2025
@CreareWorks CreareWorks force-pushed the fix/57597-batch-closure-chain-fix branch 3 times, most recently from c0f7810 to 0928e51 Compare November 24, 2025 23:43
…57597)

This fixes a fatal error (`Call to undefined method Closure::getClosure()`) when a Closure is placed immediately after a Bus::batch call within a Bus::chain.

The issue arose because the Closure object was passed as a raw `\Closure` instance to `CallQueuedClosure::displayName`, which incorrectly assumed it was always wrapped in a `SerializableClosure` and tried to call `getClosure()`.

This patch adds a check to safely extract the underlying Closure, preventing the crash.

Fixes laravel#57597
@CreareWorks CreareWorks force-pushed the fix/57597-batch-closure-chain-fix branch from 0928e51 to cfac4d0 Compare November 24, 2025 23:51
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.

Call to undefined method Closure::getClosure() when chaining closures after batches

1 participant