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

[2.x] Only apply default value when config option is not found #736

Open
wants to merge 5 commits into
base: 2.x
Choose a base branch
from

Conversation

Jade-GG
Copy link
Collaborator

@Jade-GG Jade-GG commented Feb 20, 2025

When retrieving a config option you may end up getting a value of NULL. The current implementation uses null-coalescing after getting the value, which causes that NULL to be replaced by the default value. However, if the config key does actually exist then this is not the correct behavior.

For example, if you don't want a .html suffix on your product pages, you set the config value to NULL. This then gets converted back into .html when indexing products, causing the wrong urls to be indexed.

This PR fixes that by implementing a default option into the getValue function and using that instead of the null-coalescing operator.

royduin
royduin previously approved these changes Feb 20, 2025
Copy link
Member

@royduin royduin left a comment

Choose a reason for hiding this comment

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

Looking good to me, let's wait for @indykoning his review. Maybe a nice follow-up on this: RAP-1193

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.

3 participants