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

Deprecation warning from onboarding task #2024

Closed
mikkamp opened this issue Jul 25, 2023 · 1 comment
Closed

Deprecation warning from onboarding task #2024

mikkamp opened this issue Jul 25, 2023 · 1 comment
Assignees

Comments

@mikkamp
Copy link
Contributor

mikkamp commented Jul 25, 2023

Describe the bug:

With PHP 8.2 I get the following deprecation warning:

[25-Jul-2023 10:11:59 UTC] PHP Deprecated:  Creation of dynamic property Automattic\WooCommerce\Admin\Features\OnboardingTasks\DeprecatedExtendedTask::$title is deprecated in wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/DeprecatedExtendedTask.php on line 66

It seems the creation of the dynamic property is already being resolved in PR woocommerce/woocommerce#38774

However it makes me wonder why we are triggering the DeprecatedExtendedTask class to be used. I initially thought it could be related to the Onboarding Wizard which was introduced in WooCommerce 7.9: p6q7sZ-e5D-p2
It seems the DeprecatedExtendedTask has been around longer than that.

We add the onboarding task here: https://github.com/woocommerce/google-listings-and-ads/blob/2.5.0/js/src/tasks/complete-setup/index.js#L17

So my question is whether that filter is still valid or if we need to be using a different method not to trigger any deprecated classes?

Steps to reproduce:

  1. Run the plugin on a site with PHP 8.2 and debug logging enabled
  2. Notice the deprecation message when loading the Google Listings and Ads page
@tomalec
Copy link
Member

tomalec commented Jul 25, 2023

After a brief investigation it seems the woocommerce_admin_onboarding_task_list filter was deprecated in woocommerce/woocommerce-admin#7918
in favor of TaskLists::add_task

Even though the filter is still the recommended way by the docs in https://developer.woocommerce.com/extension-developer-guide/handling-merchant-onboarding/#. Docs issue reported at woocommerce/woocommerce#33293

I think we can move completely to PHP-based task and remove the need for https://github.com/woocommerce/google-listings-and-ads/blob/trunk/src/TaskList/CompleteSetup.php#L71:L71

@tomalec tomalec self-assigned this Jul 25, 2023
tomalec added a commit that referenced this issue Jul 26, 2023
`woocommerce_admin_onboarding_task_list` is deprecated.
Fixes #2024

Remove `remove_woocommerce_extended_task_list_item` hook.

Mock the use of `$this->merchant_center->is_setup_complete()`.
@tomalec tomalec closed this as completed in ecdee9b Aug 1, 2023
matt-h pushed a commit to matt-h/google-listings-and-ads that referenced this issue Aug 8, 2023
`woocommerce_admin_onboarding_task_list` is deprecated.
Fixes woocommerce#2024

Remove `remove_woocommerce_extended_task_list_item` hook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants