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

APEX-714: Some category landing pages don't display any products on load #19

Merged
merged 8 commits into from
Apr 4, 2023

Conversation

ede-somogyi-algolia
Copy link
Contributor

@ede-somogyi-algolia ede-somogyi-algolia commented Apr 3, 2023

Managed to trace back the issue to this PR with the original issue being that using jQuery's data() method to retrieve data attribute recasts the type of the values it finds in the data attribute automatically (if it finds a number, it returns a Number).

The proposed solution in PR #10 was to use attr() instead, which leaves all values as strings.

While this fixed the original issue of data() typecasting number values as Number, it introduced another issue whereby if a data attribute was null, attr() returned it as "null" (as string), in some cases causing Algolia to return no search hits (in this case the q parameter was being set to "null").

Fixed the issue by outputting an empty string as data-q when the backend returns null as its value.

Please note that the PR contains changes from APEX-724 and APEX-721 as well, these will disappear from the diff once these PRs are merged.

@ede-somogyi-algolia ede-somogyi-algolia changed the base branch from master to develop April 3, 2023 12:23
@ede-somogyi-algolia ede-somogyi-algolia self-assigned this Apr 3, 2023
Copy link
Collaborator

@sbellone sbellone left a comment

Choose a reason for hiding this comment

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

Good finding!
(again, if you can create the branch from develop that'd be great 🙂 )

@ede-somogyi-algolia ede-somogyi-algolia merged commit 7f0441f into develop Apr 4, 2023
@ede-somogyi-algolia ede-somogyi-algolia deleted the feature/APEX-714 branch April 4, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants