Skip to content

Fix product getUrl method by aligning with Magento core behavior #1796

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fasimana
Copy link

@fasimana fasimana commented Aug 6, 2025

This commit adds the UrlRewrite::REDIRECT_TYPE => 0 parameter to the product URL filter data, ensuring that only non-redirect URL rewrites are considered when generating product URLs.
This aligns the Algolia URL generation with Magento's core URL handling behavior and prevents potential issues with redirect loops or incorrect URL generation.

Adding filter redirect_type = 0
This parameter is important because: in the core Magento Catalog/Model/Product/Url.php class, it is included in the filter data, but it's missing in the Algolia extension's version.

Without this parameter, the URL finder might return redirect URLs instead of direct URLs, which could lead to redirect chains or incorrect URL generation.

This commit adds the UrlRewrite::REDIRECT_TYPE => 0 parameter to the Algolia 
product URL filter data, ensuring that only non-redirect URL rewrites are 
considered when generating product URLs. This aligns the Algolia URL generation 
with Magento's core URL handling behavior and prevents potential issues with 
redirect loops or incorrect URL generation.
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.

1 participant