Skip to content

Commit 380b734

Browse files
committed
MC-20236: [2.2.10]Revert unapproved PR
1 parent ab23533 commit 380b734

File tree

1 file changed

+4
-14
lines changed
  • app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog

1 file changed

+4
-14
lines changed

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\Registry;
1212
use Magento\Framework\Stdlib\DateTime\Filter\Date;
1313
use Magento\Framework\App\Request\DataPersistorInterface;
14-
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1514

1615
/**
1716
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -23,42 +22,35 @@ class Save extends \Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog
2322
*/
2423
protected $dataPersistor;
2524

26-
/**
27-
* @var TimezoneInterface
28-
*/
29-
private $localeDate;
30-
3125
/**
3226
* @param Context $context
3327
* @param Registry $coreRegistry
3428
* @param Date $dateFilter
3529
* @param DataPersistorInterface $dataPersistor
36-
* @param TimezoneInterface $localeDate
3730
*/
3831
public function __construct(
3932
Context $context,
4033
Registry $coreRegistry,
4134
Date $dateFilter,
42-
DataPersistorInterface $dataPersistor,
43-
TimezoneInterface $localeDate
35+
DataPersistorInterface $dataPersistor
4436
) {
4537
$this->dataPersistor = $dataPersistor;
46-
$this->localeDate = $localeDate;
4738
parent::__construct($context, $coreRegistry, $dateFilter);
4839
}
4940

5041
/**
5142
* @return void
5243
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
53-
* @SuppressWarnings(PHPMD.NPathComplexity)
5444
*/
5545
public function execute()
5646
{
5747
if ($this->getRequest()->getPostValue()) {
48+
5849
/** @var \Magento\CatalogRule\Api\CatalogRuleRepositoryInterface $ruleRepository */
5950
$ruleRepository = $this->_objectManager->get(
6051
\Magento\CatalogRule\Api\CatalogRuleRepositoryInterface::class
6152
);
53+
6254
/** @var \Magento\CatalogRule\Model\Rule $model */
6355
$model = $this->_objectManager->create(\Magento\CatalogRule\Model\Rule::class);
6456

@@ -68,9 +60,7 @@ public function execute()
6860
['request' => $this->getRequest()]
6961
);
7062
$data = $this->getRequest()->getPostValue();
71-
if (!$this->getRequest()->getParam('from_date')) {
72-
$data['from_date'] = $this->localeDate->formatDate();
73-
}
63+
7464
$filterValues = ['from_date' => $this->_dateFilter];
7565
if ($this->getRequest()->getParam('to_date')) {
7666
$filterValues['to_date'] = $this->_dateFilter;

0 commit comments

Comments
 (0)