Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Scheduler] Fix#[AsCronTask] not passing arguments to command#60741
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Scheduler] Fix#[AsCronTask] not passing arguments to command#60741
Uh oh!
There was an error while loading.Please reload this page.
Conversation
kbond left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for finding/fixing this! Can you target 6.4?
Do you think you'd be up for adding some testshere to prevent a regression?
jan-pintr commentedJun 9, 2025
Test added. But branch was reverted to 7.3, because the problem was introduced in 7.3 (here#59711) Is it ok? |
kbond commentedJun 9, 2025
Oh, my bad - so the problem doesn't exist < 7.3? |
jan-pintr commentedJun 9, 2025
Yes, it did not exist in <7.3 |
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Messenger/DummyCommand.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
kbond left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Code looks good! I'm not 100% sure of the issue with the one CI failure.
jan-pintr commentedJun 10, 2025
Not sure either. Before test fails there is log I suppose that the reason is that the |
kbond commentedJun 10, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yeah, that's what I'm thinking It should be fixed once merged though. |
src/Symfony/Component/Scheduler/DependencyInjection/AddScheduleMessengerPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
#[AsCronTask] not passing arguments to commandjan-pintr commentedJun 20, 2025
Suggestion applied, thank you. |
cf6c25d tob57a815Comparenicolas-grekas commentedJul 9, 2025
Thank you@jan-pintr. |
7095ee9 intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
johndodev commentedAug 1, 2025
Hello, thanks, Idk if this is a real problem or something supported, but as there is no nullsafe check on $tagAttributes['arguments']here, this is breaking a tag on my use case, which is a "scheduler.task" tag added in a LoadExtension bundle I'm currently developping. I'm notifying because every others attributes seems optionnals : $myService->tag('scheduler.task', ['frequency' =>15,'schedule' =>$config['schedule'],'trigger' =>'every','arguments' =>null,// <- had to add this line to avoid a Warning: Undefined array key "arguments"]); |
jan-pintr commentedAug 2, 2025
@johndodev Please look at#61307. Even at least |
… (Jan Pintr)This PR was squashed before being merged into the 7.3 branch.Discussion----------[Scheduler] Fix `scheduler.task` tag arguments optionality| Q | A| ------------- | ---| Branch? | 7.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues | -| License | MITAccording to [this comment](#60741 (comment)) there is a change in behaviour after#60741 which causes requiring specify `arguments` parameter when tagging `scheduler.task` manually. This pull request makes `arguments` parameter back optional.```$myService->tag('scheduler.task', [ 'trigger' => 'every', 'frequency' => 15, 'arguments' => null, // <- had to add this line to avoid a Warning: Undefined array key "arguments"]);```Commits-------ad08041 [Scheduler] Fix `scheduler.task` tag arguments optionality
This MR fixes passing
AsCronTaskarguments toCommand. Reproduced can be by following command. It wont receive--alloption or any other argument specified inAsCronTaskwhen executed by Scheduler.Fix description: When command name was found in
AsCommandattribute then attributes were not appended to message definition due to missing brackets.