Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
80 stars 29 forks source link

Fixes bulk actions buttons (suspend, cancel) on Subscriptions list table not working while filtering the table #614

Closed mattallan closed 1 month ago

mattallan commented 1 month ago

Fixes #553

Description

When the subscriptions list table is being filtered by date, product, payment method or customer, the bulk action buttons under each list item (suspend, cancel etc) do not work: image

This issue is caused by the WP_List_Table::current_action() function, which is called in WooCommerce's handle_bulk_actions(), returning false when the filter_action query arg exists.

This means whenever the table is filtered, handle_bulk_actions() is not ran. To fix this I've just removed the filter_action from the action URLs.

How to test this PR

  1. Go to the WooCommerce > Subscriptions and filter the table by customer "admin"
  2. While on trunk try to use the bulk action buttons to cancel a subscription
  3. Notice the page refreshes but the subscription is not cancelled :x:
  4. Check out this branch and run the same test.

Product impact