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

Remove accidental count call within an is_array check #45939

Merged
merged 1 commit into from Mar 27, 2024

Conversation

louwie17
Copy link
Contributor

@louwie17 louwie17 commented Mar 26, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

Fixes: #45911

This is a fix that was introduced by this PR #43233, where a count call was accidentally added within an is_array call. Meaning that it would always render false.

This fixes an issue in the Analytics products page when filtering by a selected product, in which case the graph doesn't show up and it shows an error ( see issue ).

How to test the changes in this Pull Request:

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

  1. Create a WooCommerce store with a couple variable products
  2. Create an order with one of the variable products and complete it.
  3. Make sure order actions finished under WooCommerce > Status > Scheduled Actions
  4. Go to Analytics > Products
  5. Select one of the variable products that you had an order with within the Show dropdown
  6. There should be no errors and the graph should render correctly.

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

@louwie17 louwie17 requested review from asumaran and a team March 26, 2024 11:51
@louwie17 louwie17 self-assigned this Mar 26, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 26, 2024
Copy link
Contributor

Hi @asumaran, @woocommerce/mothra

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

1 similar comment
Copy link
Contributor

Hi @asumaran, @woocommerce/mothra

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 Mar 26, 2024

Test Results Summary

Commit SHA: b7c6b39

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

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

@asumaran asumaran left a comment

Choose a reason for hiding this comment

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

I can confirm the bug is there and can see the error is gone after applying the changes from this PR.

Before After

I must have forgot to test with variable products. Sorry about that.

LGTM! Thanks for fixing it @louwie17.

@louwie17 louwie17 merged commit 8f17cfe into trunk Mar 27, 2024
31 of 32 checks passed
@louwie17 louwie17 deleted the fix/analytics_comparison_by_product branch March 27, 2024 08:06
@github-actions github-actions bot added this to the 8.9.0 milestone Mar 27, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Mar 27, 2024
@alopezari alopezari 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 Mar 27, 2024
@Stojdza Stojdza modified the milestones: 8.9.0, 8.7.0 Mar 27, 2024
github-actions bot pushed a commit that referenced this pull request Mar 27, 2024
Remove accidental count call within an is_array check that always renders false
Stojdza pushed a commit that referenced this pull request Mar 27, 2024
* Remove accidental count call within an is_array check (#45939)

Remove accidental count call within an is_array check that always renders false

* Prep for cherry pick 45939

---------

Co-authored-by: louwie17 <lourensschep@gmail.com>
Co-authored-by: WooCommerce Bot <no-reply@woo.com>
@Stojdza Stojdza modified the milestones: 8.7.0, 8.8.0 Mar 28, 2024
github-actions bot pushed a commit that referenced this pull request Mar 28, 2024
Remove accidental count call within an is_array check that always renders false
Stojdza pushed a commit that referenced this pull request Mar 28, 2024
* Remove accidental count call within an is_array check (#45939)

Remove accidental count call within an is_array check that always renders false

* Prep for cherry pick 45939

---------

Co-authored-by: louwie17 <lourensschep@gmail.com>
Co-authored-by: WooCommerce Bot <no-reply@woo.com>
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.

Analytics > Products > Show Single Product > Single variation - 400 error
4 participants