Skip to content

Conversation

decius7bc
Copy link
Contributor

@decius7bc decius7bc commented Jul 15, 2017

This PR fixes the \Magento\Review\Block\Product\ReviewRenderer such that the reviews summary is shown although $displayIfNoReviews is set to false and reviews are in fact available.

Description

Always retrieve relevant data before checking whether there are active reviews if $displayIfNoReviews is set to false.

Fixed Issue

#4530: $product->getRatingSummary() always returns null on products with ratings

Manual testing scenario

Change the last parameter $displayIfNoReviews in the \Magento\Review\Block\Product\ReviewRenderer::getReviewsSummaryHtml method call to false such that the call in the template app/code/Magento/Catalog/view/frontend/templates/product/view/review.phtml looks like this

<?php echo $block->getReviewsSummaryHtml($block->getProduct(), false, false)?>

In both cases (No reviews available/at least one review is available) the reviews summary won't be shown. After applying this PR the reviews summary will be shown as expected only if there is at least one review available.

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 on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jul 15, 2017

CLA assistant check
All committers have signed the CLA.

@ishakhsuvarov ishakhsuvarov self-assigned this Jul 17, 2017
@ishakhsuvarov ishakhsuvarov added this to the July 2017 milestone Jul 17, 2017
@magento-team magento-team merged commit 63f5b8c into magento:develop Jul 18, 2017
magento-team pushed a commit that referenced this pull request Jul 18, 2017
magento-team pushed a commit that referenced this pull request Jul 18, 2017
[EngCom] Public Pull Requests

 - MAGETWO-70817: remove redundant else and use strict check #10271
 - MAGETWO-70787: update phpserver to support versioned static urls #10250
 - MAGETWO-70764: Fix overwrite default value image/file with NULL #10253
 - MAGETWO-70761: Show values that are duplicate in attribute error msg #10213
 - MAGETWO-70758: Fix for #4530 $product->getRatingSummary() always returns null […] #10248
 - MAGETWO-70706: simplify product lists #2 #9019
 - MAGETWO-70669: Fix fatal errors with deleteOptionsAndSelections #7711
 - MAGETWO-70464: Fix shipping address can use for billing #10130
 - MAGETWO-69913: magento/magento2 #9196 - Products ordered report doesn't show simple (child) products of configurable products #9908
magento-team pushed a commit that referenced this pull request Oct 7, 2017
magento-team pushed a commit that referenced this pull request Oct 7, 2017
…) always returns null […] #10248 - for 2.2

- fix after CR
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.

4 participants