Closed sergeliatko closed 2 years ago
Hi @sergeliatko,
thank you very much for reporting this issue.
We've looked into it and already resolved it in our main plugin repository.
This fix will be available in the next plugin update.
If you need a temporary fix, you can edit the line in this method: \WPMailSMTP\Admin\Pages\ActionSchedulerTab::hooks
, change this line:
add_action( 'admin_init', [ $this, 'init' ], 20 );
to:
add_action( 'current_screen', [ $this, 'init' ], 20 );
Thanks again and have a nice day!
Thanks for the quick reply. I modified my plugin to accept null or string as a second parameter on that filter. It was just to let you know you might run into an incompatibility issue if someone uses the filter as per codex.
Thanks.
We initiated the AS table too soon in the WP cycle, so the WP screen details were not available yet.
This fix will resolve any incompatibility issues with that filter.
Thank you again! 🎉
Ok, got you. Good to know for my projects. You welcome. And thank you too.
Expected Behavior
ActionScheduler_ListTable->get_primary_column_name( ) uses WP filter list_table_primary_column and must pass 2 parameters:
Both typed as string
Current Behavior
Second parameter $context (WP_Screen ID) is currently passed as null, breaking your Scheduled Actions list table when other plugins add their functions to the list_table_primary_column filter with strong type parameters.
Possible Solution
ActionScheduler_ListTable constructor does not pass the screen in args for parent contructor WP_List_Table and the parent's recovery mechanism for screen setup somehow fails.
Steps to Reproduce
I know it may be WooCommerce ActionScheduler package responsibility but it is used in your plugin. Thanks.