Skip to content

Commit 05fe43d

Browse files
ENGCOM-6069: When we throw error from event observer then getting error like Undefined variable: data #24988
2 parents 763e8e5 + ffdb8c0 commit 05fe43d

File tree

1 file changed

+2
-2
lines changed
  • app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote

1 file changed

+2
-2
lines changed

app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public function __construct(
6161
*/
6262
public function execute()
6363
{
64-
if ($this->getRequest()->getPostValue()) {
64+
$data = $this->getRequest()->getPostValue();
65+
if ($data) {
6566
try {
6667
/** @var $model \Magento\SalesRule\Model\Rule */
6768
$model = $this->_objectManager->create(\Magento\SalesRule\Model\Rule::class);
6869
$this->_eventManager->dispatch(
6970
'adminhtml_controller_salesrule_prepare_save',
7071
['request' => $this->getRequest()]
7172
);
72-
$data = $this->getRequest()->getPostValue();
7373
if (empty($data['from_date'])) {
7474
$data['from_date'] = $this->timezone->formatDate();
7575
}

0 commit comments

Comments
 (0)