Skip to content
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

Fatal errors possible when 3.9.1 runs alongside 3.9.0 or earlier #1236

Open
barryhughes opened this issue Jan 23, 2025 · 0 comments · May be fixed by #1237
Open

Fatal errors possible when 3.9.1 runs alongside 3.9.0 or earlier #1236

barryhughes opened this issue Jan 23, 2025 · 0 comments · May be fixed by #1237
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.

Comments

@barryhughes
Copy link
Member

Some recent changes touched the ActionScheduler_Versions class, as part of an effort to make it easier to determine which plugin is loading Action Scheduler (see #1218 and #1219).

The problem is that, even if 3.9.1 is the active version of Action Scheduler, the ActionScheduler_Versions class itself may come from an older version and therefore may not contain the new methods introduced in those PRs.

  • This problem can be demonstrated if you have a plugin named aaa (named as such so that it loads earlier than most other plugins) containing Action Scheduler 3.8.2, and also Action Scheduler 3.9.1.
  • Activate both and try visiting the Tools ‣ Scheduled Actions screen: the page will be broken. Via your logs, or possibly on screen if display_errors is enabled, you should be able to see that a fatal error has taken place ("call to undefined method ActionScheduler_Versions::active_source()").
  • The same problem also surfaces via a limited number of WP CLI paths, for example: wp action-scheduler source.
  • Core functionality, by which I mean the ability for plugins to add actions and have them processed asynchronously, is not impacted.

Steps to replicate

On a clean WordPress site, add two plugins. One should be Action Scheduler 3.9.1, the other should be a custom plugin named aaa/aaa.php:

<?php
/**
 * Plugin name: Test plugin
 */

require __DIR__ . '/vendor/woocommerce/action-scheduler/action-scheduler.php';

It should contain a composer.json file as follows:

{
    "require": {
        "woocommerce/action-scheduler": "3.8.2"
    }
}

Go ahead and run composer install for that plugin, then activate both of them. Next, navigate to Tools ‣ Scheduled Actions and observe the problem.

@coreymckrill coreymckrill added type: bug The issue is a confirmed bug. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants