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:
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
Go to the WooCommerce > Subscriptions and filter the table by customer "admin"
While on trunk try to use the bulk action buttons to cancel a subscription
Notice the page refreshes but the subscription is not cancelled :x:
Check out this branch and run the same test.
Product impact
[x] Added changelog entry (or does not apply)
[ ] Will this PR affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
[ ] Will this PR affect WooCommerce Payments? yes/no/tbc, add issue ref
[ ] Added deprecated functions, hooks or classes to the spreadsheet
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](https://github.com/Automattic/woocommerce-subscriptions-core/assets/2275145/2b38e527-b37d-4b09-8446-db23cee47a4a)
This issue is caused by the
WP_List_Table::current_action()
function, which is called in WooCommerce'shandle_bulk_actions()
, returningfalse
when thefilter_action
query arg exists.This means whenever the table is filtered,
handle_bulk_actions()
is not ran. To fix this I've just removed thefilter_action
from the action URLs.How to test this PR
trunk
try to use the bulk action buttons to cancel a subscriptionProduct impact