Skip to content

fix: schedule the #[Schedule] methods of the application's own classes - #5

Merged
ogorzalka merged 1 commit into
mainfrom
fix/defer-attribute-scheduling
Oct 14, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
fix/defer-attribute-scheduling

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

A #[Schedule] method in the application's own classes (app/) was never scheduled. Its discovery is applied while Laravel boots, before WordPress has loaded cron.php: CronIndex::read() called the undefined _get_cron_array(), the Error was caught by apply(), and the logger of the service is null, so nothing was placed and nothing was said. Classes of a theme, a plugin or a module are applied later and were not affected.

Found on a throwaway project on the release head; the published framework v13.35.6 behaves the same (it called wp_next_scheduled(), defined in the same file), so this is not a regression.

When did_action('init') is 0 the placement now waits for init (priority 0, before any cron is spawned); later it is immediate, as before.

Checked live (framework dev-release/v13.36.0): the event of a class in app/ is placed on the first boot and not placed again, from the CLI and from a web request, on WP-Cron; on the laravel driver it runs and queues its next occurrence about an hour later (with Pollora/framework#477).

Test: applied before init, nothing is scheduled until the init callbacks run. 107 tests, PHPStan, Pint. No tag: for the v1.0.0.

@ogorzalka
ogorzalka merged commit 70ec908 into main Oct 14, 2026
6 checks passed
@ogorzalka
ogorzalka deleted the fix/defer-attribute-scheduling branch October 14, 2026 08:33
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.

1 participant