Skip to content

Replace an Internal namespace class method used in HPOS compatibility#2350

Merged
ibndawood merged 2 commits intodevelopfrom
fix/2347-replace-internal-ns-classes
Nov 7, 2022
Merged

Replace an Internal namespace class method used in HPOS compatibility#2350
ibndawood merged 2 commits intodevelopfrom
fix/2347-replace-internal-ns-classes

Conversation

@ibndawood
Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request:

Closes #2347

The Internal namespace class CustomOrdersTableController should not be used. The method custom_orders_table_usage_is_enabled is replaced by a static method from OrderUtil public class which mirrors the Internal class method

  • Do the changed files pass phpcs checks? Please remove phpcs:ignore comments in changed files and fix any issues, or delete if not practical.

Detailed test instructions:

  1. Enable HPOS and initial sync of orders by following the instructions given here: https://github.com/woocommerce/woocommerce/wiki/High-Performance-Order-Storage-Upgrade-Recipe-Book#how-to-enable-hpos
  2. Generate the build for this branch and install.
  3. Navigate to WooCommerce > Settings > Advanced > Custom data stores and set Data store for orders option to Use the WooCommerce orders tables.
  4. Navigate to WooCommerce > Orders and click on any single order.
  5. Click on view source and verify facebook-for-woocommerce-modal, wc-facebook-google-product-category-fields and tmpl-facebook-for-woocommerce-modal are enqueued.
  6. Navigate to WooCommerce > Settings > Advanced > Custom data stores and set Data store for orders option to Use the WordPress posts table.
  7. Navigate to WooCommerce > Orders and click on any single order.
  8. Click on view source and verify facebook-for-woocommerce-modal, wc-facebook-google-product-category-fields and tmpl-facebook-for-woocommerce-modal are enqueued.

Additional details:

This PR simply corrects the class used in #2345

Changelog entry

Dev - Replaced methods from classes in the Internal namespace

…ass namesspace

The Internal namespace class CustomOrdersTableController should not be used. The method custom_orders_table_usage_is_enabled
is replaced by a static method from OrderUtil public class which mirrors the Internal class method
@github-actions github-actions bot added changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug. labels Nov 1, 2022
@ibndawood ibndawood marked this pull request as ready for review November 1, 2022 12:58
@ibndawood ibndawood requested a review from a team November 1, 2022 12:59
@ibndawood ibndawood self-assigned this Nov 1, 2022
Copy link
Copy Markdown
Contributor

@JPry JPry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, though I've added a few suggestions.

Comment thread includes/Admin.php Outdated
Comment thread tests/_support/AcceptanceTester.php
Comment thread tests/_support/AcceptanceTester.php
Thank you.

Co-authored-by: Jeremy Pry <JPry@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@rawdreeg rawdreeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good. Thanks, @ibndawood!

@ibndawood
Copy link
Copy Markdown
Contributor Author

Thank you @rawdreeg 👍

@ibndawood ibndawood merged commit 32e3a18 into develop Nov 7, 2022
@ibndawood ibndawood deleted the fix/2347-replace-internal-ns-classes branch November 7, 2022 11:24
@ibndawood ibndawood mentioned this pull request Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Internal namespace classes used in HPOS compatibility

3 participants