Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Scheduler] Add warning about comma-separated weekdays inPeriodicalTrigger#21212

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

Merged

Conversation

wazum
Copy link
Contributor

@wazumwazum commentedJul 17, 2025
edited
Loading

Issue

symfony/symfony#60745

Users attempt to use comma-separated weekdays like "Monday, Thursday, Saturday" with RecurringMessage::every(), which causes silent failures due to PHP's DateInterval::createFromDateString()

Solution

Added a caution note in the PeriodicalTrigger section warning users about this limitation and providing the correct alternative using cron expressions.

Changes

  • Added .. caution:: block in the Periodical Triggers section
  • Shows the problematic usage pattern to avoid
  • Provides working cron expression alternative: RecurringMessage::cron('5 12 * * 1,4,6', $message)
  • Includes timezone handling example: RecurringMessage::cron('5 12 * * 1,4,6', $message, 'Europe/Warsaw')

@carsonbotcarsonbot added this to the6.4 milestoneJul 17, 2025
@wazumwazumforce-pushed theadd-scheduler-comma-warning branch from7cc7412 to47eed9dCompareJuly 17, 2025 07:35
@wazumwazumforce-pushed theadd-scheduler-comma-warning branch from47eed9d toc974e6dCompareJuly 17, 2025 08:03
@carsonbotcarsonbot changed the titleAdd warning about comma-separated weekdays in PeriodicalTrigger[Scheduler] Add warning about comma-separated weekdays in PeriodicalTriggerJul 17, 2025
@OskarStarkOskarStark changed the title[Scheduler] Add warning about comma-separated weekdays in PeriodicalTrigger[Scheduler] Add warning about comma-separated weekdays inPeriodicalTriggerJul 17, 2025
scheduler.rst Outdated
@@ -286,6 +286,20 @@ defined by PHP datetime functions::
RecurringMessage::every('3 weeks', new Message());
RecurringMessage::every('first Monday of next month', new Message());

..warning::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
..warning::
..note::

scheduler.rst Outdated
Comment on lines 300 to 301
// With timezone (equivalent to the every() method with DateTimeImmutable):
RecurringMessage::cron('5 12 * * 1,4,6', new Message(), 'Europe/Warsaw');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
// With timezone (equivalent to the every() method with DateTimeImmutable):
RecurringMessage::cron('5 12 * * 1,4,6', new Message(), 'Europe/Warsaw');

scheduler.rst Outdated
Comment on lines 293 to 298

// Instead of this (not supported):
RecurringMessage::every('Monday, Thursday, Saturday', new Message());

// Use this:
RecurringMessage::cron('5 12 * * 1,4,6', new Message());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
// Instead of this (not supported):
RecurringMessage::every('Monday, Thursday, Saturday', new Message());
// Use this:
RecurringMessage::cron('5 12 * * 1,4,6', new Message());
..code-block::diff
- RecurringMessage::every('Monday, Thursday, Saturday', new Message());
+ RecurringMessage::cron('5 12 * * 1,4,6', new Message());

@javiereguiluz
Copy link
Member

Thanks Wolfgang ... and congrats on your first Symfony Docs contribution 🎉

wazum reacted with hooray emoji

@javiereguiluzjaviereguiluz merged commit352ab1f intosymfony:6.4Jul 17, 2025
3 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@OskarStarkOskarStarkOskarStark left review comments

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

4 participants
@wazum@javiereguiluz@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp