Skip to content

[Backport][Review] Fix Pending Reviews label, add menu for pending review #21849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/code/Magento/Review/Block/Adminhtml/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Review\Block\Adminhtml;

/**
Expand Down Expand Up @@ -56,6 +57,7 @@ public function __construct(
*
* @return void
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
*/
protected function _construct()
{
Expand Down Expand Up @@ -159,13 +161,13 @@ protected function _construct()
}

if ($this->getRequest()->getParam('ret', false) == 'pending') {
$this->buttonList->update('back', 'onclick', 'setLocation(\'' . $this->getUrl('catalog/*/pending') . '\')');
$this->buttonList->update('back', 'onclick', 'setLocation(\'' . $this->getUrl('review/*/pending') . '\')');
$this->buttonList->update(
'delete',
'onclick',
'deleteConfirm(' . '\'' . __(
'Are you sure you want to do this?'
) . '\' ' . '\'' . $this->getUrl(
) . '\', ' . '\'' . $this->getUrl(
'*/*/delete',
[$this->_objectId => $this->getRequest()->getParam($this->_objectId), 'ret' => 'pending']
) . '\'' . ')'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Exception\LocalizedException;

/**
* Save Review action.
*/
class Save extends ProductController
{
/**
* Save Review action.
*
* @return \Magento\Backend\Model\View\Result\Redirect
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
Expand Down Expand Up @@ -63,7 +68,7 @@ public function execute()
if ($nextId) {
$resultRedirect->setPath('review/*/edit', ['id' => $nextId]);
} elseif ($this->getRequest()->getParam('ret') == 'pending') {
$resultRedirect->setPath('*/*/pending');
$resultRedirect->setPath('review/*/pending');
} else {
$resultRedirect->setPath('*/*/');
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Review/etc/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<resource id="Magento_Backend::marketing">
<resource id="Magento_Backend::marketing_user_content">
<resource id="Magento_Review::reviews_all" title="Reviews" translate="title" sortOrder="10"/>
<resource id="Magento_Review::pending" title="Reviews" translate="title" sortOrder="20"/>
<resource id="Magento_Review::pending" title="Pending Reviews" translate="title" sortOrder="20"/>
</resource>
</resource>
</resource>
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Review/etc/adminhtml/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<menu>
<add id="Magento_Review::catalog_reviews_ratings_ratings" title="Rating" translate="title" module="Magento_Review" sortOrder="60" parent="Magento_Backend::stores_attributes" action="review/rating/" resource="Magento_Review::ratings"/>
<add id="Magento_Review::catalog_reviews_ratings_reviews_all" title="Reviews" translate="title" module="Magento_Review" parent="Magento_Backend::marketing_user_content" sortOrder="10" action="review/product/index" resource="Magento_Review::reviews_all"/>
<add id="Magento_Review::catalog_reviews_ratings_pending" title="Pending Reviews" translate="title" module="Magento_Review" parent="Magento_Backend::marketing_user_content" sortOrder="15" action="review/product/pending" resource="Magento_Review::pending"/>
<add id="Magento_Review::report_review" title="Reviews" translate="title" module="Magento_Reports" sortOrder="20" parent="Magento_Reports::report" resource="Magento_Reports::review"/>
<add id="Magento_Review::report_review_customer" title="By Customers" translate="title" sortOrder="10" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/customer" resource="Magento_Reports::review_customer"/>
<add id="Magento_Review::report_review_product" title="By Products" translate="title" sortOrder="20" module="Magento_Review" parent="Magento_Review::report_review" action="reports/report_review/product" resource="Magento_Reports::review_product"/>
Expand Down