Automattic / woocommerce-services

WooCommerce Services is a feature plugin that integrates hosted services into WooCommerce (3.0+), and currently includes automated tax rates and the ability to purchase and print USPS shipping labels.
GNU General Public License v2.0
108 stars 20 forks source link

Tracks event `migration_flag_state_update` calls variable that doesn't exist #2803

Closed kallehauge closed 2 months ago

kallehauge commented 2 months ago

If you go to WC_Connect_Loader::plugin_deactivation, then we have a "duplicate" of the migration_flag_state_update that is also triggered in WC_REST_Connect_Migration_Flag_Controller::post. It looks like it was first implemented in the endpoint, and then copied to the deactivation hook where $result doesn't exist.

In the REST endpoint we use the result of update_option() as the updated prop. From what I can see, then we should hardcode the below event to use false since we never call any update, but only "get":

https://github.com/Automattic/woocommerce-services/blob/0048b18afd8ae0bf38261a03b3cd728a431ce446/woocommerce-services.php#L270-L282