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 reference assignment operator #52583

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

octaedro
Copy link
Contributor

@octaedro octaedro commented Nov 5, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR eliminates the reference assignment operator from the following files:

cross-sells
upsells
related

The presence of the reference assignment operator in these files was causing unexpected behaviors.

Before

Screen.Recording.on.2024-11-21.at.01-11-03.mp4

After

after.mp4

There is a more detailed explanation here.

Closes #42785.

Acknowledgements

A big shoutout to @alexiglesias31 for collaborating on this issue and bringing it to our attention. Your vigilance and contributions are greatly appreciated! 🙌

How to test the changes in this Pull Request:

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

  1. Create a new simple product.
  2. Go to Pages > Add New Page
  3. Add a Shortcode block and paste [product_page id="your-product-id"]. Replace your-product-id with the id of the product you just created.
  4. Press Publish and refresh the page.
  5. The editor should load the page that is being edited, not the product referred to in the shortcode.

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

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

Changelog Entry Comment

Comment

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

github-actions bot commented Nov 5, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Contributor

@danielwrobert danielwrobert left a comment

Choose a reason for hiding this comment

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

@octaedro I've tested and confirmed this change works as expected and, per our discussion in Slack (p1730226517486409-slack-C02FL3X7KR6), it's probably a better approach than manually resetting the query.

It seems possible that these reference assignment operators are the root cause of the bug to begin with and this issue was just not noticed until much later.

@octaedro octaedro force-pushed the dev/poc_delete_reference_assignment_operator branch from 0523d89 to 5398b98 Compare November 21, 2024 15:16
@octaedro octaedro force-pushed the dev/poc_delete_reference_assignment_operator branch from 5b262e9 to f57d865 Compare November 21, 2024 16:52
@octaedro octaedro self-assigned this Nov 21, 2024
Copy link
Contributor

github-actions bot commented Nov 21, 2024

Hi @danielwrobert, @woocommerce/woo-fse

Apart from reviewing the code changes, please make sure to review the testing instructions and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

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

@octaedro octaedro marked this pull request as ready for review November 21, 2024 17:27
@woocommercebot woocommercebot requested a review from a team November 21, 2024 17:27
Copy link
Contributor

@danielwrobert danielwrobert left a comment

Choose a reason for hiding this comment

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

Tested again and confirmed everything still works as expected.

Thanks for working on this! 🚀

@octaedro octaedro merged commit 4b0913a into trunk Nov 21, 2024
43 checks passed
@octaedro octaedro deleted the dev/poc_delete_reference_assignment_operator branch November 21, 2024 18:40
@github-actions github-actions bot added this to the 9.6.0 milestone Nov 21, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Nov 21, 2024
@alexiglesias31
Copy link
Contributor

Thanks for accepting the collaboration @octaedro @danielwrobert 🚀

@rodelgc rodelgc 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 Nov 27, 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.

[V8.4.0] WC Shortcode [product_page id="xxxx"] Prevents Page Editing, Opens WooCommerce Product Details
4 participants