Skip to content

Commit 9212fa3

Browse files
authored
ENGCOM-3131: Fix: Exception Error in Catalog Price Rule while Backend language is not English #18419
2 parents b3776c9 + 8b23f69 commit 9212fa3

File tree

1 file changed

+16
-1
lines changed
  • app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog

1 file changed

+16
-1
lines changed

app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Magento\Framework\App\Request\DataPersistorInterface;
1515

1616
/**
17+
* Save action for catalog rule
18+
*
1719
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1820
*/
1921
class Save extends \Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog implements HttpPostActionInterface
@@ -40,7 +42,9 @@ public function __construct(
4042
}
4143

4244
/**
43-
* @return void
45+
* Execute save action from catalog rule
46+
*
47+
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
4448
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
4549
*/
4650
public function execute()
@@ -61,6 +65,17 @@ public function execute()
6165
['request' => $this->getRequest()]
6266
);
6367
$data = $this->getRequest()->getPostValue();
68+
69+
$filterValues = ['from_date' => $this->_dateFilter];
70+
if ($this->getRequest()->getParam('to_date')) {
71+
$filterValues['to_date'] = $this->_dateFilter;
72+
}
73+
$inputFilter = new \Zend_Filter_Input(
74+
$filterValues,
75+
[],
76+
$data
77+
);
78+
$data = $inputFilter->getUnescaped();
6479
$id = $this->getRequest()->getParam('rule_id');
6580
if ($id) {
6681
$model = $ruleRepository->get($id);

0 commit comments

Comments
 (0)