-
Notifications
You must be signed in to change notification settings - Fork 9.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
Fix 'promotion' region not rendering #25373 #25374
Conversation
The getRegion(name) method returns a knockoutjs observable array which is a function, so the check used in the template will always resolve to false (as function `length` property is the number of arguments a function takes, which for the observable array is 0). Therefore the region is never rendered. The fix from this PR is a bit ugly, but simple.
Hi @mattijv. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @mattijv, thank you for your contribution! |
Hi @mattijv, thank you for your contribution! |
Apparently there is some latency to the CLA signing being registered? I'm going to try closing and reopening this PR later. |
Hi @mattijv, thank you for your contribution! |
As far as I can tell, all the failing checks are unrelated to the changes in this PR. |
As #25375 seems to be the preferred fix for the related issue, I'll close this PR as redundant. |
Hi @mattijv, thank you for your contribution! |
The getRegion(name) method returns a knockoutjs observable array which is a function, so the check used in the template will always resolve to false (as function
length
property is the number of arguments a function takes, which for the observable array is 0). Therefore the region is never rendered.Description (*)
The fix in this PR follows the current convention used in Magento and adds the missing parentheses to the if condition.
Fixed Issues (if relevant)
Manual testing scenarios (*)
See related issue
Questions and comments
This PR is an alternative to #25375. The fix implement in this PR simple and follows the existing code conventions in Magento, but does nothing to prevent a similar mistake from happening in the future.
Contribution checklist (*)