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 fatal strpos in ComparisonOperation 8.5 branch #44033

Merged
merged 2 commits into from Jan 25, 2024

Conversation

ilyasfoo
Copy link
Contributor

@ilyasfoo ilyasfoo commented Jan 24, 2024

Submission Review Guidelines:

Related to fix in #44007

Changes proposed in this Pull Request:

  • Adds defensive checks

How to test the changes in this Pull Request:

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

  1. Set up a fresh site
  2. Go to WooCommerce Setup Wizard
  3. In country step, select Australia (to trigger the RIN rule)
  4. Skip plugins step
  5. Observe no fatal

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

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jan 24, 2024
Copy link
Contributor

Test Results Summary

Commit SHA: dae3464

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

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.

@ilyasfoo ilyasfoo requested review from a team, psealock and chihsuan January 24, 2024 14:37
Copy link
Contributor

Hi @psealock, @chihsuan, @woocommerce/ghidorah

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

@psealock psealock left a comment

Choose a reason for hiding this comment

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

This tests well and changes are consistent with https://github.com/woocommerce/woocommerce/pull/44007/files.

Do we need to consider the change that caused this in the first place? I'm not fully understanding what changed in order to make this fail.

Copy link
Member

@chihsuan chihsuan 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 and tested well! 🚢

@ilyasfoo
Copy link
Contributor Author

Do we need to consider the change that caused this in the first place? I'm not fully understanding what changed in order to make this fail.

Thanks, @psealock! Yes, this will be address in follow-up PRs. Some of the details are recorded in this post (pf59Ax-D1-p2#comment-415):

It seems the way that dot_notation transformer works is when a value obtained is null, the transformer returns the previous value. This resulted in the evaluator unexpectedly returning an array instead of a string, causing the error in strpos.

@ilyasfoo ilyasfoo changed the title Fix fatal strpos in ComparisonOperation Fix fatal strpos in ComparisonOperation 8.5 branch Jan 25, 2024
@nigeljamesstevenson nigeljamesstevenson merged commit 202f4ba into release/8.5 Jan 25, 2024
27 of 30 checks passed
@nigeljamesstevenson nigeljamesstevenson deleted the fix/strpos-in-ComparisonOperation branch January 25, 2024 12:28
@alopezari alopezari added fix release: 8.5.1 Temporary label for fix release metrics retrieval fix release: 8.5.2 Temporary label for fix release metrics retrieval and removed fix release: 8.5.1 Temporary label for fix release metrics retrieval labels Feb 6, 2024
@alopezari alopezari added this to the 8.5.0 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix release: 8.5.2 Temporary label for fix release metrics retrieval plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants