From 774164c2ae589e45fd3bdfcf09a6de4c6b0cba1a Mon Sep 17 00:00:00 2001 From: saphal Date: Tue, 30 Oct 2018 11:30:19 +0530 Subject: [PATCH] core modified as per instructions --- .../Magento/Review/Model/ResourceModel/Rating.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index debaf61c4dd4b..df138ed8173be 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -34,18 +34,12 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected $_logger; - /** - * @var \Magento\Framework\App\State - */ - protected $_state; - /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\ResourceModel\Review\Summary $reviewSummary - * @param \Magento\Framework\App\State * @param string $connectionName */ public function __construct( @@ -54,14 +48,12 @@ public function __construct( \Magento\Framework\Module\Manager $moduleManager, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\ResourceModel\Review\Summary $reviewSummary, - \Magento\Framework\App\State $state, $connectionName = null ) { $this->moduleManager = $moduleManager; $this->_storeManager = $storeManager; $this->_logger = $logger; $this->_reviewSummary = $reviewSummary; - $this->_state = $state; parent::__construct($context, $connectionName); } @@ -433,11 +425,11 @@ public function getReviewSummary($object, $onlyForCurrentStore = true) $data = $connection->fetchAll($select, [':review_id' => $object->getReviewId()]); - $currentStore = ($this->_state->getAreaCode() == "adminhtml") ? false : $this->_storeManager->getStore()->getId(); + $currentStore = ($this->_storeManager->isSingleStoreMode()) ? $this->_storeManager->getStore()->getId() : NULL ; if ($onlyForCurrentStore) { foreach ($data as $row) { - if ($row['store_id'] == $currentStore) { + if (!$row['store_id'] == NULL) { $object->addData($row); } }