Skip to content

Commit 81b740b

Browse files
MC-19716: Cannot change action settings of scheduled update for cart rule
1 parent 3557f77 commit 81b740b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
namespace Magento\SalesRule\Controller\Adminhtml\Promo\Quote;
77

88
use Magento\Framework\App\Action\HttpPostActionInterface;
9+
use Magento\Rule\Model\Condition\AbstractCondition;
910
use Magento\SalesRule\Controller\Adminhtml\Promo\Quote;
11+
use Magento\SalesRule\Model\Rule;
1012

1113
/**
1214
* New action html action
@@ -20,8 +22,10 @@ class NewActionHtml extends Quote implements HttpPostActionInterface
2022
*/
2123
public function execute()
2224
{
23-
$id = $this->getRequest()->getParam('id');
24-
$formName = $this->getRequest()->getParam('form_namespace');
25+
$id = $this->getRequest()
26+
->getParam('id');
27+
$formName = $this->getRequest()
28+
->getParam('form_namespace');
2529
$typeArr = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
2630
$type = $typeArr[0];
2731

@@ -32,20 +36,22 @@ public function execute()
3236
)->setType(
3337
$type
3438
)->setRule(
35-
$this->_objectManager->create(\Magento\SalesRule\Model\Rule::class)
39+
$this->_objectManager->create(Rule::class)
3640
)->setPrefix(
3741
'actions'
3842
);
3943
if (!empty($typeArr[1])) {
4044
$model->setAttribute($typeArr[1]);
4145
}
4246

43-
if ($model instanceof \Magento\Rule\Model\Condition\AbstractCondition) {
47+
if ($model instanceof AbstractCondition) {
4448
$model->setJsFormObject($formName);
49+
$model->setFormName($formName);
4550
$html = $model->asHtmlRecursive();
4651
} else {
4752
$html = '';
4853
}
49-
$this->getResponse()->setBody($html);
54+
$this->getResponse()
55+
->setBody($html);
5056
}
5157
}

0 commit comments

Comments
 (0)