Skip to content

Commit 5bb1a40

Browse files
committed
MC-19862: [Function Test] MC-148 Magento\FunctionalTestingFramework.functional.ApplyCatalogPriceRuleByProductAttributeTest
1 parent b0e70c7 commit 5bb1a40

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,15 @@ public function __construct(
5555
*
5656
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
5757
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
58+
* @SuppressWarnings(PHPMD.NPathComplexity)
5859
*/
5960
public function execute()
6061
{
6162
if ($this->getRequest()->getPostValue()) {
62-
6363
/** @var \Magento\CatalogRule\Api\CatalogRuleRepositoryInterface $ruleRepository */
6464
$ruleRepository = $this->_objectManager->get(
6565
\Magento\CatalogRule\Api\CatalogRuleRepositoryInterface::class
6666
);
67-
6867
/** @var \Magento\CatalogRule\Model\Rule $model */
6968
$model = $this->_objectManager->create(\Magento\CatalogRule\Model\Rule::class);
7069

@@ -74,7 +73,6 @@ public function execute()
7473
['request' => $this->getRequest()]
7574
);
7675
$data = $this->getRequest()->getPostValue();
77-
7876
if (!$this->getRequest()->getParam('from_date')) {
7977
$data['from_date'] = $this->localeDate->formatDate();
8078
}

app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false)
101101
$scopeTz = new \DateTimeZone(
102102
$this->localeDate->getConfigTimezone(ScopeInterface::SCOPE_WEBSITE, $websiteId)
103103
);
104-
$fromTime = (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp();
104+
$fromTime = $rule->getFromDate()
105+
? (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp()
106+
: 0;
105107
$toTime = $rule->getToDate()
106108
? (new \DateTime($rule->getToDate(), $scopeTz))->getTimestamp() + IndexBuilder::SECONDS_IN_DAY - 1
107109
: 0;

0 commit comments

Comments
 (0)