Skip to content

Commit

Permalink
Merge pull request #57 from magento-api/MAGETWO-39663-NEW-Product-Sav…
Browse files Browse the repository at this point in the history
…e-Through-API-Service-Is-Not-Visible-On-Frontend

[API+FearlessKiwis+Vanilla] MAGETWO-39663 Product save through API, MAGETWO-44491 revert executeInternal to execute, Frontend Bug Fixes
  • Loading branch information
Tang, Yu(ytang1) committed Nov 4, 2015
2 parents 2fc9834 + 7e17cc9 commit 54baca5
Show file tree
Hide file tree
Showing 1,190 changed files with 2,361 additions and 2,032 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AjaxMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Not
*
* @return void
*/
public function executeInternal()
public function execute()
{
if (!$this->getRequest()->getPostValue()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Index extends \Magento\AdminNotification\Controller\Adminhtml\Notification
/**
* @return void
*/
public function executeInternal()
public function execute()
{
$this->_view->loadLayout();
$this->_setActiveMenu(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notific
/**
* @return void
*/
public function executeInternal()
public function execute()
{
$notificationId = (int)$this->getRequest()->getParam('id');
if ($notificationId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MassMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Not
/**
* @return void
*/
public function executeInternal()
public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MassRemove extends \Magento\AdminNotification\Controller\Adminhtml\Notific
/**
* @return void
*/
public function executeInternal()
public function execute()
{
$ids = $this->getRequest()->getParam('notification');
if (!is_array($ids)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Remove extends \Magento\AdminNotification\Controller\Adminhtml\Notificatio
/**
* @return void
*/
public function executeInternal()
public function execute()
{
if ($id = $this->getRequest()->getParam('id')) {
$model = $this->_objectManager->create('Magento\AdminNotification\Model\Inbox')->load($id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
/**
* @return void
*/
public function executeInternal()
public function execute()
{
$severity = $this->getRequest()->getParam('severity');
if ($severity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GetFilter extends ExportController
*
* @return \Magento\Framework\Controller\ResultInterface
*/
public function executeInternal()
public function execute()
{
$data = $this->getRequest()->getParams();
if ($this->getRequest()->isXmlHttpRequest() && $data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function executeInternal()
public function execute()
{
$paymentParam = $this->getRequest()->getParam('payment');
$controller = $this->getRequest()->getParam('controller');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function _returnQuote($cancelOrder, $errorMsg)
*
* @return \Magento\Framework\View\Result\Layout
*/
public function executeInternal()
public function execute()
{
$redirectParams = $this->getRequest()->getParams();
$params = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function _returnQuote()
*
* @return void
*/
public function executeInternal()
public function execute()
{
$this->_returnQuote();
$this->getResponse()->representJson(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Paymen
*
* @return void
*/
public function executeInternal()
public function execute()
{
$this->_responseAction('adminhtml');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(
*
* @return string
*/
public function executeInternal()
public function execute()
{
$paymentParam = $this->getRequest()->getParam('payment');
$controller = $this->getRequest()->getParam('controller');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Redirect extends \Magento\Authorizenet\Controller\Directpost\Payment
*
* @return void
*/
public function executeInternal()
public function execute()
{
$helper = $this->dataFactory->create('frontend');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Response extends \Magento\Authorizenet\Controller\Directpost\Payment
*
* @return void
*/
public function executeInternal()
public function execute()
{
$this->_responseAction('frontend');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ReturnQuote extends \Magento\Authorizenet\Controller\Directpost\Payment
*
* @return void
*/
public function executeInternal()
public function execute()
{
$this->_returnCustomerQuote();
$this->getResponse()->representJson(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ class RedirectTest extends \PHPUnit_Framework_TestCase
*/
protected $helperMock;

/**
* @var Redirect|\PHPUnit_Framework_MockObject_MockObject
*/
protected $controller;

protected function setUp()
{
$this->directpostSessionMock = $this->getMockBuilder('Magento\Authorizenet\Model\Directpost\Session')
Expand Down Expand Up @@ -201,7 +196,7 @@ protected function setUp()
);
}

public function testExecuteInternalErrorMsgWithoutCancelOrder()
public function testExecuteErrorMsgWithoutCancelOrder()
{
$params = ['success' => 0, 'error_msg' => 'Error message'];
$incrementId = 1;
Expand Down Expand Up @@ -243,10 +238,10 @@ public function testExecuteInternalErrorMsgWithoutCancelOrder()
->method('register')
->with(Iframe::REGISTRY_KEY);

$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->executeInternal());
$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->execute());
}

public function testExecuteInternalErrorMsgWithCancelOrder()
public function testExecuteErrorMsgWithCancelOrder()
{
$params = ['success' => 0, 'error_msg' => 'Error message', 'x_invoice_num' => 1];
$incrementId = 1;
Expand Down Expand Up @@ -278,10 +273,10 @@ public function testExecuteInternalErrorMsgWithCancelOrder()
->method('register')
->with(Iframe::REGISTRY_KEY);

$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->executeInternal());
$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->execute());
}

public function testExecuteInternalSuccess()
public function testExecuteSuccess()
{
$params = ['success' => 1, 'controller_action_name' => 'action', 'x_invoice_num' => 1];
$this->requestMock->expects($this->once())
Expand Down Expand Up @@ -312,6 +307,6 @@ public function testExecuteInternalSuccess()
->method('register')
->with(Iframe::REGISTRY_KEY);

$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->executeInternal());
$this->assertInstanceOf('\Magento\Framework\View\Result\Layout', $this->controller->execute());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function testExecute(
->method('jsonEncode')
->with($result);

$this->placeOrderController->executeInternal();
$this->placeOrderController->execute();
}

/**
Expand Down Expand Up @@ -243,7 +243,7 @@ public function testExecuteFailedPlaceOrder(
->method('jsonEncode')
->with($result);

$this->placeOrderController->executeInternal();
$this->placeOrderController->execute();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ private function _moveBlockToContainer(\Magento\Framework\View\Element\AbstractB
* @param \Magento\Framework\App\RequestInterface $request
* @return \Magento\Framework\App\ResponseInterface
*/
public function execute(\Magento\Framework\App\RequestInterface $request)
public function dispatch(\Magento\Framework\App\RequestInterface $request)
{
if (!$this->_processUrlKeys()) {
return parent::execute($request);
return parent::dispatch($request);
}

if ($request->isDispatched() && $request->getActionName() !== 'denied' && !$this->_isAllowed()) {
Expand All @@ -223,7 +223,7 @@ public function execute(\Magento\Framework\App\RequestInterface $request)

$this->_processLocaleSettings();

return parent::execute($request);
return parent::dispatch($request);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function __construct(
* @return mixed
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function aroundExecute(
public function aroundDispatch(
\Magento\Backend\App\AbstractAction $subject,
\Closure $proceed,
\Magento\Framework\App\RequestInterface $request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MassactionKey
* @return mixed
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function aroundExecute(
public function aroundDispatch(
\Magento\Backend\App\AbstractAction $subject,
\Closure $proceed,
\Magento\Framework\App\RequestInterface $request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
*
* @return \Magento\Framework\Controller\Result\Json
*/
public function executeInternal()
public function execute()
{
$translate = (array)$this->getRequest()->getPost('translate');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function _getDeniedIframe()
*
* @return \Magento\Framework\Controller\Result\Raw
*/
public function executeInternal()
public function execute()
{
/** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
$resultRaw = $this->resultRawFactory->create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function _getDeniedJson()
*
* @return \Magento\Framework\Controller\Result\Json
*/
public function executeInternal()
public function execute()
{
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
$resultJson = $this->resultJsonFactory->create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
if ($this->_auth->isLoggedIn()) {
if ($this->_auth->getAuthStorage()->isFirstPageAfterLogin()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Logout extends \Magento\Backend\Controller\Adminhtml\Auth
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
$this->_auth->logout();
$this->messageManager->addSuccess(__('You have logged out.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
/**
* @return \Magento\Framework\Controller\ResultInterface
*/
public function executeInternal()
public function execute()
{
$resultRedirect = $this->resultRedirectFactory->create();
if ($this->getRequest()->getParam('app')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CleanImages extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
try {
$this->_objectManager->create('Magento\Catalog\Model\Product\Image')->clearCache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CleanMedia extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
try {
$this->_objectManager->get('Magento\Framework\View\Asset\MergeService')->cleanMergedJsCss();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CleanStaticFiles extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
$this->_objectManager->get('Magento\Framework\App\State\CleanupFiles')->clearMaterializedViewFiles();
$this->_eventManager->dispatch('clean_static_files_cache_after');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FlushAll extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
$this->_eventManager->dispatch('adminhtml_cache_flush_all');
/** @var $cacheFrontend \Magento\Framework\Cache\FrontendInterface */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FlushSystem extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
/** @var $cacheFrontend \Magento\Framework\Cache\FrontendInterface */
foreach ($this->_cacheFrontendPool as $cacheFrontend) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Index extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Page
*/
public function executeInternal()
public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MassDisable extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
try {
$types = $this->getRequest()->getParam('types');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MassEnable extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
try {
$types = $this->getRequest()->getParam('types');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MassRefresh extends \Magento\Backend\Controller\Adminhtml\Cache
*
* @return \Magento\Backend\Model\View\Result\Redirect
*/
public function executeInternal()
public function execute()
{
try {
$types = $this->getRequest()->getParam('types');
Expand Down
Loading

0 comments on commit 54baca5

Please sign in to comment.