-
Notifications
You must be signed in to change notification settings - Fork 119
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
Call to undefined function as_next_scheduled_action() #730
Comments
I'm not immediately able to replicate: Is anything besides Ethereum Wallet 2.8.0 and WooCommerce 5.5.0 required to see the problem, and can you provide some steps-to-replicate in case I'm missing something? Any other potentially relevant information you can provide (such as the versions of PHP and WP are you using, or if opting in or out of Freemius impacts the problem) appreciated. |
@barryhughes Thank you for your reply. I've updated free plugin version to the latest one. update and try again please. |
@olegabr—this feels verrry similar to #724: can you repeat the same treatment we used there? Interestingly, in my own testing I find if I apply that same fix as last time not only does it resolve the problem, but if I subsequently revert the fix the problem still doesn't come back. This tends to make me think the issue is somehow related to the way Freemius works (and that, once some sort of flag is set, whatever process triggers the problem is not repeated). My provisional recommendation though would be continuing to apply the same fix we used last time any time you rebuild or refactor your main plugin file. Whatever is causing this would seem to be atypical and not a direct result of anything Action Scheduler does (unless, of course, it can be distilled down to a something that can be replicated with a simple test plugin that does not involve that other library). |
@barryhughes Yes, it helped, thank you. I've totally forgot the same issue with another plugin, sorry.
This PR makes them not to load the class tested to not break checks in another plugins. |
@barryhughes Just found that premium version still fails on a plugin activation:
I've compared it with free version line by one and see no reason why. Send me your email to support at ethereumico dot io for a premium plugin license please. For now I have this workaround for the premium version:
|
The reason why only premium version crashes now, is that the free version does not call |
Just updated my another site to the latest WC 5.5.1 and got this fatal error:
The only my plugin I had here is https://wordpress.org/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/ After renaming it's folder site works again. That is exactly why this PR is needed - not only woocommerce can crash other plugins, other plugins can crash woocommerce, if they were loaded first I assume. |
Fresh report from a client - "now I try to remove some order in woocommerce. it will occur error:"
|
For now my plan is to fork the action-scheduler library, apply this PR to it and use this forked library in my plugins to not break woocommerce. And use the workaround above to not let woocommerce break my plugins. Wierd, yeah :-) |
OK, well that sounds like a reasonable interim step. Regarding the patch you wrote (to avoid triggering autoloaders during |
Yes, it can be tested on this free plugin: https://wordpress.org/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/ |
New report for the same issue for another my Ethereum Wallet plugin: https://wordpress.org/support/topic/fatal-error-after-update-rankmath/ |
Adding my voice to this. We shipped an extension update on Friday last week that bundles AS v3.3.0. That works fine on a "standard" WooCommerce install (tested with WC 5.7.x which bundles AS v3.2.1). However, we're receiving support tickets from users where it appears that v3.3.0 isn't being loaded ( It appears this happens where v3.1.6* of AS is bundled by another plugin on the site (In the cases we've seen so far, the culprit is WooCommerce Smart Coupons). In this case, it looks like v3.3.0 isn't loaded properly and we get undefined function errors.
|
There's a ZIP here that contains two stripped down plugins that illustrate the issue. To reproduce the issue install, and activate both of these on a fresh WordPress install uses-as-3.1.6Requires version 3.1.6 of action scheduler at plugins_loaded / -1 and does nothing else uses-as-3.3.0Requires version 3.3.0 of action scheduled as the plugin is loaded e.g. straight include in plugin file, then attempts (on init) to call This yields the error: Notes
|
Thank you, I'm able to replicate with those steps.
|
Couple notes:
|
Fresh report from a client. He has the https://ethereumico.io/product/wordpress-ethereum-wallet-plugin/ installed, and has an issue with another plugin (https://wordpress.org/plugins/seo-by-rank-math/) using action scheduler internally:
|
Just got such error while updating plugins on my own site now :-)
|
I've updated the action-scheduler version in my plugins to 3.3.0 and tested this free plugin: Only one other plugin using the action-scheduler library was activated: woocommerce How to reproduce: try to remove or restore order. I've tried to move the initialization line to the very top of my plugin file with no effect: require_once dirname( __FILE__ ) . '/vendor/woocommerce/action-scheduler/action-scheduler.php'; The error shown:
|
Thanks for this note: taking a further look 👍 |
@olegabr to confirm, does your composer.json file contain something like this (possibly alongside other entries for other libraries)?
(Asking because I can't verify myself, as that file isn't present in the wordpress.org/plugins distribution and I don't think this repo is current, either.) ...If it does not, could you share the actual |
Current thinking:
For clarity, I'll also note here this is a separate issue to the one described in this comment (though both happen to relate to the loading and version resolution process). |
@barryhughes I do not have such entries in my composer.json file, but there are autoload entries generated by composer. Here is an example lines: $ grep scheduler -R vendor/composer/
vendor/composer/autoload_classmap.php: 'ActionMigrator_Test' => $vendorDir . '/woocommerce/action-scheduler/tests/phpunit/migration/ActionMigrator_Test.php',
vendor/composer/autoload_classmap.php: 'ActionScheduler' => $vendorDir . '/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php',
vendor/composer/autoload_classmap.php: 'ActionScheduler_Abstract_ListTable' => $vendorDir . '/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php', |
@barryhughes Also, if the #731 patch is applied to the 3.3.0 action-scheduler version, it stops break woocommerce in this simple installation example. |
Yes, I saw those entries (but I didn't think they were normally generated without an
Great—that matches my expectations and we'll get that merged, though I can create cases where merging that PR does not solve the problem (it would depend on plugin load order and the version of Action Scheduler being loaded by each plugin). |
@barryhughes thank you! When can we expect the merged version to be released? Just need to decide to wait or patch my version as a temporary solution for now. |
I would hope within the next 2 weeks, approximately. Though, I'm afraid I can't offer any guarantees. |
New reports after last WooCommerce update: ` Stack trace: #0 /home/ethereumico.io/public_html/wp-content/plugins/ethereum-wallet-premium/ethereum-wallet.php(665): as_schedule_single_action(1663164077, 'ETHEREUM_WALLET...', Array, 'ethereum-wallet...') After sync with the 3.4.2 tag as used in the WC now: ` Stack trace: #0 /home/ethereumico.io/public_html/wp-content/plugins/ethereum-wallet-premium/ethereum-wallet.php(665): as_schedule_single_action(1663179322, 'ETHEREUM_WALLET...', Array, 'ethereum-wallet...') So, looks like all plugins installed should use the same action-scheduler version to eliminate conflicts. |
Hi @olegabr, Can you create a new issue (this one is closed) and include some steps to replicate? If specific code or a specific plugin is needed alongside WooCommerce, can you also provide details/links as needed? That will also make it easier for others experiencing this issue to share notes, etc. Thanks :-) |
If action-scheduler is used in a plugin on a site running WooCommerce 5.5.0, site crashed with error
Call to undefined function as_next_scheduled_action()
I've got 10+ reports from plugin users today :-)
The text was updated successfully, but these errors were encountered: