We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5177344 commit 78af5b8Copy full SHA for 78af5b8
app/code/Magento/Review/Controller/Adminhtml/Product/Post.php
@@ -10,6 +10,7 @@
10
use Magento\Framework\Controller\ResultFactory;
11
use Magento\Store\Model\Store;
12
use Magento\Framework\Exception\LocalizedException;
13
+use Magento\Review\Model\Review;
14
15
class Post extends ProductController implements HttpPostActionInterface
16
{
@@ -33,7 +34,7 @@ public function execute()
33
34
}
35
$review = $this->reviewFactory->create()->setData($data);
36
try {
- $review->setEntityId(1) // product
37
+ $review->setEntityId($review->getEntityIdByCode(Review::ENTITY_PRODUCT_CODE))
38
->setEntityPkValue($productId)
39
->setStoreId(Store::DEFAULT_STORE_ID)
40
->setStatusId($data['status_id'])
0 commit comments