diff --git a/Controller/Adminhtml/Ecommerce/CreateWebhook.php b/Controller/Adminhtml/Ecommerce/CreateWebhook.php index e9cb1fb1..39575d20 100644 --- a/Controller/Adminhtml/Ecommerce/CreateWebhook.php +++ b/Controller/Adminhtml/Ecommerce/CreateWebhook.php @@ -74,15 +74,12 @@ public function execute() $message = $return['message']; } $resultJson = $this->resultJsonFactory->create(); - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("CreateWebhook", [ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("CreateWebhook", $ret); + return $resultJson->setData($ret); } protected function _isAllowed() { diff --git a/Controller/Adminhtml/Ecommerce/DeleteStore.php b/Controller/Adminhtml/Ecommerce/DeleteStore.php index da3a8c3a..4fa89ccf 100644 --- a/Controller/Adminhtml/Ecommerce/DeleteStore.php +++ b/Controller/Adminhtml/Ecommerce/DeleteStore.php @@ -89,15 +89,12 @@ public function execute() $valid = 0; $message = $e->getMessage(); } - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("DeleteStore", [ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("DeleteStore",$ret); + return $resultJson->setData($ret); } protected function _isAllowed() { diff --git a/Controller/Adminhtml/Ecommerce/FixMailchimpJS.php b/Controller/Adminhtml/Ecommerce/FixMailchimpJS.php index f3b1bbbc..5fc3fc9d 100644 --- a/Controller/Adminhtml/Ecommerce/FixMailchimpJS.php +++ b/Controller/Adminhtml/Ecommerce/FixMailchimpJS.php @@ -76,15 +76,12 @@ public function execute() $valid = 0; $message = $e->getMessage(); } - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("FixMailchimpJS", [ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("FixMailchimpJS", $ret); + return $resultJson->setData($ret); } protected function _isAllowed() { diff --git a/Controller/Adminhtml/Ecommerce/ResetLocalErrors.php b/Controller/Adminhtml/Ecommerce/ResetLocalErrors.php index 9c1a33e6..c134a8b7 100644 --- a/Controller/Adminhtml/Ecommerce/ResetLocalErrors.php +++ b/Controller/Adminhtml/Ecommerce/ResetLocalErrors.php @@ -93,15 +93,12 @@ public function execute() $valid = 0; $message = $e->getMessage(); } - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("ResetLocalErrors",[ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("ResetLocalErrors",$ret); + return $resultJson->setData($ret); } protected function _isAllowed() { diff --git a/Controller/Adminhtml/Ecommerce/ResetLocalErrorsNoRetry.php b/Controller/Adminhtml/Ecommerce/ResetLocalErrorsNoRetry.php index 9517e47f..b96e4ddd 100644 --- a/Controller/Adminhtml/Ecommerce/ResetLocalErrorsNoRetry.php +++ b/Controller/Adminhtml/Ecommerce/ResetLocalErrorsNoRetry.php @@ -93,15 +93,12 @@ public function execute() $valid = 0; $message = $e->getMessage(); } - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("ResetLocalErrorNoRetry",[ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("ResetLocalErrorNoRetry",$ret); + return $resultJson->setData($ret); } protected function _isAllowed() { diff --git a/Controller/Adminhtml/Ecommerce/ResetStore.php b/Controller/Adminhtml/Ecommerce/ResetStore.php index 8c964c15..1a2ff3bf 100644 --- a/Controller/Adminhtml/Ecommerce/ResetStore.php +++ b/Controller/Adminhtml/Ecommerce/ResetStore.php @@ -82,15 +82,12 @@ public function execute() $valid = 0; $message = $e->getMessage(); } - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("ResetStore", [ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("ResetStore",$ret); + return $resultJson->setData($ret); } protected function _isAllowed() { diff --git a/Controller/Adminhtml/Ecommerce/ResyncProducts.php b/Controller/Adminhtml/Ecommerce/ResyncProducts.php index ac4919e4..cd53b66f 100644 --- a/Controller/Adminhtml/Ecommerce/ResyncProducts.php +++ b/Controller/Adminhtml/Ecommerce/ResyncProducts.php @@ -71,15 +71,12 @@ public function execute() $valid = 0; $message = $e->getMessage(); } - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("ResyncProducts", [ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("ResyncProducts", $ret); + return $resultJson->setData($ret); } protected function _isAllowed() { diff --git a/Controller/Adminhtml/Ecommerce/ResyncSubscribers.php b/Controller/Adminhtml/Ecommerce/ResyncSubscribers.php index d692a619..6eaa40ab 100644 --- a/Controller/Adminhtml/Ecommerce/ResyncSubscribers.php +++ b/Controller/Adminhtml/Ecommerce/ResyncSubscribers.php @@ -72,15 +72,12 @@ public function execute() $valid = 0; $message = $e->getMessage(); } - $resultJson->setData([ + $ret = [ 'valid' => (int)$valid, 'message' => $message, - ]); - $this->helper->buttonPressed("ResyncSubscribers", [ - 'valid' => (int)$valid, - 'message' => $message, - ]); - return $resultJson; + ]; + $this->helper->buttonPressed("ResyncSubscribers", $ret); + return $resultJson->setData($ret); } protected function _isAllowed() {