Skip to content

Commit ffdb8c0

Browse files
ENGCOM-6069: When we throw error from event observer then getting error like Undefined variable: data #24988
- Merge Pull Request #24988 from ronak2ram/magento2:update-promo-code-save - Merged commits: 1. 9035b0b
2 parents ea73279 + 9035b0b commit ffdb8c0

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)