This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Fix: 404 error for No results block CSS file #11854
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit introduces the `get_block_type_style` method in the `ProductCollectionNoResults` class. This new method is designed to manage frontend style handling specifically for this block type. Currently, it returns null, indicating no specific styles are assigned at this stage.
imanish003
changed the title
Add get_block_type_style method in ProductCollectionNoResults
Fix: 404 error for No results block CSS file
Nov 21, 2023
imanish003
added
skip-changelog
PRs that you don't want to appear in the changelog.
block: product collection
Issues related to the Product Collection block
labels
Nov 21, 2023
The release ZIP for this PR is accessible via:
TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the |
woocommercebot
requested review from
a team and
kmanijak
and removed request for
a team
November 21, 2023 06:17
Size Change: 0 B Total Size: 1.59 MB ℹ️ View Unchanged
|
kmanijak
approved these changes
Nov 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected!
There's another issue that we found that happens when there's no results displayed on the frontend:
frontend.tsx:125 Uncaught TypeError: Cannot read properties of undefined (reading 'cart')
at Object.hasCartLoaded (frontend.tsx:125:29)
at frontend.tsx:294:34
But that's confirmed unrelated to "No Results" block, so approving!
wavvves
pushed a commit
that referenced
this pull request
Nov 21, 2023
This commit introduces the `get_block_type_style` method in the `ProductCollectionNoResults` class. This new method is designed to manage frontend style handling specifically for this block type. Currently, it returns null, indicating no specific styles are assigned at this stage.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block: product collection
Issues related to the Product Collection block
skip-changelog
PRs that you don't want to appear in the changelog.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
As "No results" block doesn't have any CSS file, it's showing 404 error on Frontend. I fixed the issue by adding following function to frontend PHP file:
Why
Because it was resulting in 404 error as reported on Slack(p1700510341080839/1700496653.600189-slack-C02UBB1EPEF)
Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
Screenshots or screencast
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog