-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Payment method preferences don't use default values if using static model preferences #3718
Comments
Hey @seand7565 Do you think there's a case when the user wouldn't want the defaults to be returned in the options hash? If we always return the preference defaults there will be no way to remove them with the static model preferences. |
Hmm, that's an interesting question. Ultimately, as a developer, I would expect something set as a default to always be returned as the default option (if nothing else is set). I think someone could make the case that setting I'm not sure that there's a use case for removing items from preferences - I think it makes more sense just to statically set them to something different (or just I guess another way of thinking about would be this: Currently, when you don't set a preference in |
Marking this as a bug, even if I'm not 100% convinced that either way it will be counterintuitive for someone. |
When setting up a payment methods preferences, you can define a default value if those preferences aren't explicitly set by the user. However, if the user is using static model preferences, these default values are not used.
Solidus Version:
2.10 - though likely an issue with more versions.
To Reproduce
nil
instead of the default value.Current behavior
Accessing preferences not explicitly set in static model preferences returns nil instead of the default value
Expected behavior
Accessing preferences not explicitly set in static model preferences should return the default value
Screenshots
![image](https://user-images.githubusercontent.com/5720486/88089620-f1ef4200-cb51-11ea-85db-c794b071cd8a.png)
![image](https://user-images.githubusercontent.com/5720486/88089566-d8e69100-cb51-11ea-957e-df8a0011caee.png)
(default value with default preference source)
(default value with static preference source)
The text was updated successfully, but these errors were encountered: