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

Fix 'promotion' region not rendering #25373 #25374

Closed
wants to merge 1 commit into from

Conversation

mattijv
Copy link
Contributor

@mattijv mattijv commented Oct 30, 2019

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)

  1. The 'promotion' region of the minicart is never rendered #25373: The 'promotion' region of the minicart is never rendered

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 (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

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.
@mattijv mattijv requested a review from paliarush as a code owner October 30, 2019 13:40
@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2019

Hi @mattijv. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2019

Hi @mattijv, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@mattijv mattijv reopened this Oct 30, 2019
@mattijv mattijv closed this Oct 30, 2019
@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2019

Hi @mattijv, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@mattijv mattijv reopened this Oct 30, 2019
@mattijv
Copy link
Contributor Author

mattijv commented Oct 30, 2019

Apparently there is some latency to the CLA signing being registered? I'm going to try closing and reopening this PR later.

@mattijv mattijv closed this Nov 1, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 1, 2019

Hi @mattijv, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@mattijv mattijv reopened this Nov 1, 2019
@mattijv
Copy link
Contributor Author

mattijv commented Nov 4, 2019

As far as I can tell, all the failing checks are unrelated to the changes in this PR.

@mattijv
Copy link
Contributor Author

mattijv commented Nov 13, 2019

As #25375 seems to be the preferred fix for the related issue, I'll close this PR as redundant.

@mattijv mattijv closed this Nov 13, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 13, 2019

Hi @mattijv, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants