Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation notices for legacy order item keys. #44362

Merged
merged 2 commits into from Feb 8, 2024

Conversation

mikejolley
Copy link
Member

@mikejolley mikejolley commented Feb 5, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

I've split this off from https://github.com/woocommerce/woocommerce/pull/44181/files and this fixes the same issue as #41567

Under PHP 8.2 we see some notices on the frontend:

PHP Deprecated: Creation of dynamic property WC_Order_Item_Product::$legacy_values is deprecated
PHP Deprecated: Creation of dynamic property WC_Order_Item_Product::$legacy_cart_item_key is deprecated
PHP Deprecated: Creation of dynamic property WC_Order_Item_Shipping::$legacy_package_key is deprecated

By declaring the properties we fix the issue.

Closes #41567

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Before using this PR:

  1. Install query monitor plugin on a store running PHP 8.2+
  2. browse to the checkout page with items in your cart logged in as admin
  3. you'll see "Creation of dynamic property WC_Order_Item_Shipping::$legacy_package_key is deprecated" notices caught by query monitor

After applying this PR:

  1. Repeat the above steps. No notices will be caught by query monitor.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@mikejolley mikejolley self-assigned this Feb 5, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 5, 2024
@woocommercebot woocommercebot requested review from a team and opr and removed request for a team February 5, 2024 14:07
Copy link
Contributor

github-actions bot commented Feb 5, 2024

Hi @opr,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

github-actions bot commented Feb 5, 2024

Test Results Summary

Commit SHA: 68ee51a

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests30800603146m 38s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

Copy link
Contributor

@opr opr left a comment

Choose a reason for hiding this comment

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

Thanks Mike, this is working fine for me. Just take a look at CI because it is stuck and also the testing instructions are fine for devs, but when this will be tested by GlobalStep they won't be able to follow the instructions (e.g. "apply this patch") so can we re-write them to be simpler (or somehow mark this as not needing testing)?

@mikejolley mikejolley force-pushed the fix/41567-deprecated-legacy-keys branch from 48a9d44 to 68ee51a Compare February 8, 2024 11:42
@mikejolley mikejolley merged commit 509ac4f into trunk Feb 8, 2024
34 checks passed
@mikejolley mikejolley deleted the fix/41567-deprecated-legacy-keys branch February 8, 2024 12:51
@github-actions github-actions bot added this to the 8.7.0 milestone Feb 8, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 8, 2024
@veljkho veljkho added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants