Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
85 stars 31 forks source link

Fix parent order link in subscription details box on subscription admin edit page #378

Closed shendy-a8c closed 1 year ago

shendy-a8c commented 1 year ago

Fixes #371

Description

Parent order link in subscription details box, below the subscription status dropdown is incorrect when HPOS is enabled with WC orders as authoritative and sync off, specific to this configuration.

Screenshot 2023-01-13 at 03 11 36

This problem is because we call get_edit_post_link() here and since the parent order in the posts table is a post with typeshop_order_placehold, the _edit_link is an empty string.

How to test this PR

  1. Enable HPOS, choose WC orders table as the authoritative data store, and set sync off.
  2. Create a subscription. It can have no line items.
  3. Create a pending parent order.
  4. With base branch, the parent order link below the Subscription status dropdown is empty so clicking it will just reload the same page (the subscription edit page). With head branch, the link will bring to the subscription's parent order edit page.

Product impact

james-allan commented 1 year ago

Changes look good and test well.

I've confirmed: