Skip to content

Commit bf5faf8

Browse files
author
Sergey Shvets
committed
MAGETWO-95491: Product Review "Save and Next" and "Save and Previous" not working
1 parent 2fa2d35 commit bf5faf8

File tree

1 file changed

+16
-5
lines changed
  • app/code/Magento/Review/Model/ResourceModel/Review/Product

1 file changed

+16
-5
lines changed

app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Review\Model\ResourceModel\Review\Product;
78

89
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
@@ -116,7 +117,8 @@ public function __construct(
116117
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
117118
ProductLimitationFactory $productLimitationFactory = null,
118119
MetadataPool $metadataPool = null
119-
) {
120+
)
121+
{
120122
$this->_ratingFactory = $ratingFactory;
121123
$this->_voteFactory = $voteFactory;
122124
parent::__construct(
@@ -403,11 +405,20 @@ public function getAllIds($limit = null, $offset = null)
403405
public function getResultingIds()
404406
{
405407
$idsSelect = clone $this->getSelect();
406-
$idsSelect->reset(Select::LIMIT_COUNT);
407-
$idsSelect->reset(Select::LIMIT_OFFSET);
408+
$data = $this->getConnection()
409+
->fetchAll(
410+
$idsSelect
411+
->reset(Select::LIMIT_COUNT)
412+
->reset(Select::LIMIT_OFFSET)
413+
->columns('rt.review_id')
414+
);
408415

409-
$idsSelect->columns('rt.review_id');
410-
return $this->getConnection()->fetchCol($idsSelect);
416+
return array_map(
417+
function ($value) {
418+
return $value['review_id'];
419+
},
420+
$data
421+
);
411422
}
412423

413424
/**

0 commit comments

Comments
 (0)