Skip to content

Commit 0cc1ce2

Browse files
ENGCOM-3532: [Backport] small performance improvement on product listing #19336
- Merge Pull Request #19336 from gelanivishal/magento2:2.2-develop-PR-port-18773 - Merged commits: 1. f15ddaf
2 parents 32a7c4b + f15ddaf commit 0cc1ce2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/code/Magento/Review/Model/Review.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Review\Model;
77

8+
use Magento\Framework\DataObject;
89
use Magento\Catalog\Model\Product;
910
use Magento\Framework\DataObject\IdentityInterface;
1011
use Magento\Review\Model\ResourceModel\Review\Product\Collection as ProductCollection;
@@ -327,6 +328,9 @@ public function appendSummary($collection)
327328
$item->setRatingSummary($summary);
328329
}
329330
}
331+
if (!$item->getRatingSummary()) {
332+
$item->setRatingSummary(new DataObject());
333+
}
330334
}
331335

332336
return $this;

0 commit comments

Comments
 (0)