Skip to content

Commit 1bde3b5

Browse files
ENGCOM-3437: small performance improvement on product listing #18773
- Merge Pull Request #18773 from godvsdeity/magento2:performance-improvement - Merged commits: 1. 53b5b49
2 parents 57d7010 + 53b5b49 commit 1bde3b5

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)