action-scheduler icon indicating copy to clipboard operation
action-scheduler copied to clipboard

Fatal error on ActionFactory class

Open kermage opened this issue 2 years ago • 5 comments
trafficstars

wp-mail-smtp

seo-by-rank-math

Plugin Version
cardanopress-governance 3.5.3
wp-mail-smtp 3.6.1
seo-by-rank-math 3.6.3

There seems to be an issue with loading the right class which should be from the latest version.

From what I can tell, the functions.php file loaded was of the 3.6+ version but the action factory used was from the older 3.5 version which does not have the create method

kermage avatar Oct 06 '23 02:10 kermage

For whoever at Automattic picks this:

  • Useful info: p7bje6-3wM-p2
  • Please make the above information public, maybe by converting it to a post in the WooCommerce developer blog (and then add a link here: https://actionscheduler.org/faq/).

Konamiman avatar Oct 09 '23 08:10 Konamiman

Are there any work arounds for this issue?

pbwebdev avatar Nov 16 '23 01:11 pbwebdev

Hi @pbwebdev!

We're still looking into ways to address this, as it's a bit of an edge case. Our suggestion for now would be to make sure that you're running up to date plugins, so that their dependencies (Action Scheduler in particular) are also up to date. If any of your plugins is using an old version of Action Scheduler, nudging the developers so that they update their copy of AS will certainly help.

jorgeatorres avatar Nov 16 '23 13:11 jorgeatorres

From what I can tell, the functions.php file loaded was of the 3.6+ version but the action factory used was from the older 3.5 version which does not have the create method

The root of this seems to be the use of Jetpack Autoloader with a static classmap from within Cardanopress Governance, which contains all of the Action Scheduler classes.

In situations like this one, that will 'subvert' Action Scheduler's own version resolution procedure and potentially cause an intermixing of classes from different versions—which, of course, if the problem we're facing here.

@kermage are you one of the developers of that plugin? Can you exclude Action Scheduler from the static classmap?

barryhughes avatar Nov 16 '23 17:11 barryhughes

...In the meantime, some other ideas that may solve this:

  • Install and activate the latest version of Action Scheduler (ie, as a standalone plugin).
  • Or, if that doesn't work, move it to the mu-plugins directory.

The principle being if we can get the latest version of Action Scheduler (and, importantly, its class loader) to be first, we might solve the problem that way.

barryhughes avatar Nov 16 '23 18:11 barryhughes

Closing, as it's essentially beyond our control if other products load Action Scheduler in a way that isn't recommended.

barryhughes avatar Aug 23 '24 00:08 barryhughes