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 wrong Shop title shown in classic themes after deleting the page #46429

Merged
merged 3 commits into from Apr 10, 2024

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Apr 10, 2024

Changes proposed in this Pull Request:

This PR partially reverts some changes introduced in #44537.

Rationale: we had some code that made sure the Shop page title was Shop. While we initially wrote that code to be applied only to block themes, given that BlockTemplatesController was run also in classic themes, it caused the change to apply to classic themes as well. When we moved that logic to the ProductCatalogTemplate class in #44537, it stopped being run in classic themes, causing the regression.

This PR moves the code back to BlockTemplatesController to make sure it runs in classic themes as well.

This is a temporary solution. If this code is expected to run in classic and block themes, ideally it shouldn't be in BlockTemplatesController.

Kudos to @jorgeatorres for finding the root of the issue!

How to test the changes in this Pull Request:

  1. Activate a classic theme (ie: Storefront).
  2. Go to Pages and send the Shop page to the Trash.
  3. Visit the shop in the frontend (ie: /shop).
  4. Verify the page title is Shop instead of Products or something similar. Important: check the title of the page that is in the <title> tags, that means the title that appears in the tab bar.
  5. Restore the Shop page so it's not in the Trash anymore.
  6. Switch to a block theme (ie: Twenty Twenty Four).
  7. Repeat steps 2-4.
Before After
imatge imatge

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

@Aljullu Aljullu added focus: template Issue related to WooCommerce templates. team: Kirigami & Origami labels Apr 10, 2024
@Aljullu Aljullu self-assigned this Apr 10, 2024
@woocommercebot woocommercebot requested review from a team and samueljseay and removed request for a team April 10, 2024 15:50
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Apr 10, 2024
Copy link
Contributor

@gigitux gigitux left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@kmanijak kmanijak left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Hi @samueljseay,

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

@Aljullu Aljullu merged commit 76bbd95 into trunk Apr 10, 2024
49 checks passed
@Aljullu Aljullu deleted the fix/wrong-shop-title-after-deletion-in-classic-themes branch April 10, 2024 17:45
@github-actions github-actions bot added this to the 8.9.0 milestone Apr 10, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Apr 10, 2024
@nigeljamesstevenson nigeljamesstevenson added needs: internal testing Indicates if the PR requires further testing conducted by Solaris 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 Apr 10, 2024
@rodelgc rodelgc modified the milestones: 8.9.0, 8.8.0 Apr 11, 2024
github-actions bot pushed a commit that referenced this pull request Apr 11, 2024
…46429)

* Fix wrong Shop title shown in classic themes after deleting the page

* Add changelog file

* Add explanatory comment
rodelgc pushed a commit that referenced this pull request Apr 11, 2024
* Fix wrong Shop title shown in classic themes after deleting the page (#46429)

* Fix wrong Shop title shown in classic themes after deleting the page

* Add changelog file

* Add explanatory comment

* Prep for cherry pick 46429

---------

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.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
focus: template Issue related to WooCommerce templates. needs: internal testing Indicates if the PR requires further testing conducted by Solaris plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Kirigami & Origami
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants