You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for such a great tool. I have been using it to all my projects where i am have to deal with scheduled actions.
I did notice a weird fatal though when we changed location for action scheduler in plugins i am working for.
The fatal was during the upgrade of said plugin.
What was happening behind the scenes ?
Please do have in mind how php would load files and objects into memory during this example. It took me some time to figure out how that is possible.
Action scheduler registers an action during shutdown here
The file above is already loaded into memory and an instance of ActionScheduler_QueueRunner. We can be sure of that because we are using $this to refer to it.
By the time the request though reaches the shutdown hook and as a result the callback.
if this was an upgrade request to the plugin that includes Action scheduler, Action scheduler files may have been moved!
The already in memory vendor/autoload.php would point to file no longer in place for retrieving the singleton instance returned by ActionScheduler::lock(). Causing a fatal.
Steps to recreate:
create a third party single file plugin.
require action scheduler through composer.
init action scheduler in your third party plugin.
install this plugin in your wp installation.
create a zip which we would treat as an update to the above plugin.
remove action scheduler through composer and simply include it another directory e.g. as
change the require in your main plugin file to point to the new location of action scheduler.
create an installable zip.
upgrade your plugin in your wp instalaltion.
the fatal should be present (as long as WP_DEBUG is true and display errors true should be visible as well).
Possible solution:
I think the simplest solution would be to NOT hook into shutdown if the current request is an upgrade request for plugin(s) or bail early during the shutdown callback.
The text was updated successfully, but these errors were encountered:
First of all, thank you for such a great tool. I have been using it to all my projects where i am have to deal with scheduled actions.
I did notice a weird fatal though when we changed location for action scheduler in plugins i am working for.
The fatal was during the upgrade of said plugin.
What was happening behind the scenes ?
Please do have in mind how php would load files and objects into memory during this example. It took me some time to figure out how that is possible.
Action scheduler registers an action during shutdown here
The file above is already loaded into memory and an instance of
ActionScheduler_QueueRunner
. We can be sure of that because we are using$this
to refer to it.By the time the request though reaches the
shutdown
hook and as a result the callback.if this was an upgrade request to the plugin that includes Action scheduler, Action scheduler files may have been moved!
The already in memory vendor/autoload.php would point to file no longer in place for retrieving the singleton instance returned by
ActionScheduler::lock()
. Causing a fatal.Steps to recreate:
create a third party single file plugin.
require action scheduler through composer.
init action scheduler in your third party plugin.
install this plugin in your wp installation.
create a zip which we would treat as an update to the above plugin.
remove action scheduler through composer and simply include it another directory e.g.
as
change the require in your main plugin file to point to the new location of action scheduler.
create an installable zip.
upgrade your plugin in your wp instalaltion.
the fatal should be present (as long as WP_DEBUG is true and display errors true should be visible as well).
Possible solution:
I think the simplest solution would be to NOT hook into
shutdown
if the current request is an upgrade request for plugin(s) or bail early during theshutdown
callback.The text was updated successfully, but these errors were encountered: