Skip to content

Commit c8f2893

Browse files
author
Stanislav Idolov
authored
ENGCOM-3532: [Backport] small performance improvement on product listing #19336
2 parents 5d05219 + 0cc1ce2 commit c8f2893

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)