Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Magento\Framework\App\Request\DataPersistorInterface;

/**
* Save action for catalog rule
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Save extends \Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog implements HttpPostActionInterface
Expand All @@ -40,7 +42,9 @@ public function __construct(
}

/**
* @return void
* Execute save action from catalog rule
*
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute()
Expand All @@ -61,6 +65,17 @@ public function execute()
['request' => $this->getRequest()]
);
$data = $this->getRequest()->getPostValue();

$filterValues = ['from_date' => $this->_dateFilter];
if ($this->getRequest()->getParam('to_date')) {
$filterValues['to_date'] = $this->_dateFilter;
}
$inputFilter = new \Zend_Filter_Input(
$filterValues,
[],
$data
);
$data = $inputFilter->getUnescaped();
$id = $this->getRequest()->getParam('rule_id');
if ($id) {
$model = $ruleRepository->get($id);
Expand Down