Automattic / woocommerce-subscriptions-core

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

[HPOS] Replace missing variable in WCS_Admin_Meta_Boxes::add_meta_boxes() #347

Closed Jinksi closed 1 year ago

Jinksi commented 1 year ago

Resolves https://github.com/Automattic/woocommerce-subscriptions-core/pull/297#discussion_r1040509678

Note This PR is targeting the hpos-admin-ui-support branch due to the changes required for admin screens in HPOS environments awaiting merge

Description

A variable was inadvertently removed from the hpos-admin-ui-support branch from the WCS_Admin_Meta_Boxes::add_meta_boxes(), causing an error on the subscription edit page to appear (https://github.com/Automattic/woocommerce-subscriptions-core/pull/297#discussion_r1040509678).

image

This PR resolves this error by replacing the variable.

I have also renamed the $screen variable to $order_screen_id to help to distinguish it from $subscriptions_screen_id.

How to test this PR

  1. Checkout this branch and the https://github.com/woocommerce/woocommerce/pull/35658 WC branch
  2. Enable HPOS.
  3. View a subscription (WC → Subscriptions).
  4. Ensure no Undefined variable $current_screen error occurs.
  5. Ensure the related orders metabox is visible on both the Edit Order and Edit Subscription screen.

Product impact

Jinksi commented 1 year ago

Check failing due to changes on base branch hpos-admin-ui-support.