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

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

Closed
mattijv opened this issue Oct 30, 2019 · 2 comments
Closed

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

mattijv opened this issue Oct 30, 2019 · 2 comments
Assignees
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@mattijv
Copy link
Contributor

mattijv commented Oct 30, 2019

Preconditions (*)

  1. M2.3.1 or later (and possibly some later M2.2 versions too)

Steps to reproduce (*)

  1. Add a component to the 'promotion' region of the minicart jsLayout

Expected result (*)

  1. Component is rendered

Actual result (*)

  1. Component is not rendered

Cause

The issue was introduced in #20383 where an if-binding was added to the minicart-widgets div to prevent the div from being rendered if the 'promotion' region does not contain any elements. Unfortunately the if was written badly as the conditional is checking the length property of the observable returned from getRegion (always 0) instead of the array contained in the observable. This means the conditional is always false and the element is never rendered.

Possible fixes

I've create two mutually exclusive PR's that solve the issue in two ways.

#25374 Fixes the if-clause by adding the missing parentheses.

#25375 Is a bit more involved fix as it adds a separate method to the collection component that can be used to check if a region contains elements. It also modifies existing uses of the getRegion(region)().length pattern to use the new method.

@m2-assistant
Copy link

m2-assistant bot commented Oct 30, 2019

Hi @mattijv. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

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

@mattijv do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 30, 2019
@ghost ghost assigned mattijv Oct 30, 2019
@ghost ghost assigned mattijv and unassigned mattijv Oct 30, 2019
@ghost ghost assigned mattijv and unassigned mattijv Nov 13, 2019
@VladimirZaets VladimirZaets added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Jan 17, 2020
@VladimirZaets
Copy link
Contributor

Hi @mattijv. Thank you for your report.
The issue has been fixed in #25375 by @mattijv in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

magento-engcom-team added a commit that referenced this issue Jan 17, 2020
 - Merge Pull Request #25375 from mattijv/magento2:minicart-fix
 - Merged commits:
   1. 20d3f40
   2. 9b6c8d7
   3. ca8c75a
   4. f9eb4e4
   5. 109392d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

3 participants