Skip to content

Commit aa69b8b

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MC-16684
2 parents e92aada + 89cf888 commit aa69b8b

File tree

25 files changed

+141
-88
lines changed

25 files changed

+141
-88
lines changed

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/type/bundle/option/multi.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
1717
<input type="hidden"
1818
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
19-
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"/>
19+
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"
20+
class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> bundle option"/>
2021
<?php else : ?>
2122
<select multiple="multiple"
2223
size="5"

app/code/Magento/CatalogRule/Model/Rule.php

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* @SuppressWarnings(PHPMD.TooManyFields)
4747
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
4848
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
49+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
4950
*/
5051
class Rule extends \Magento\Rule\Model\AbstractModel implements RuleInterface, IdentityInterface
5152
{
@@ -433,7 +434,7 @@ protected function _getWebsitesMap()
433434
}
434435

435436
/**
436-
* {@inheritdoc}
437+
* @inheritdoc
437438
*/
438439
public function validateData(DataObject $dataObject)
439440
{
@@ -582,12 +583,16 @@ protected function _invalidateCache()
582583
}
583584

584585
/**
585-
* {@inheritdoc}
586+
* @inheritdoc
586587
*
587588
* @return $this
588589
*/
589590
public function afterSave()
590591
{
592+
if (!$this->getIsActive()) {
593+
return parent::afterSave();
594+
}
595+
591596
if ($this->isObjectNew() && !$this->_ruleProductProcessor->isIndexerScheduled()) {
592597
$productIds = $this->getMatchingProductIds();
593598
if (!empty($productIds) && is_array($productIds)) {
@@ -606,14 +611,19 @@ public function afterSave()
606611
*/
607612
public function reindex()
608613
{
609-
$productIds = $this->_productIds ? array_keys(array_filter($this->_productIds, function (array $data) {
610-
return array_filter($data);
611-
})) : [];
614+
$productIds = $this->_productIds ? array_keys(
615+
array_filter(
616+
$this->_productIds,
617+
function (array $data) {
618+
return array_filter($data);
619+
}
620+
)
621+
) : [];
612622
$this->_ruleProductProcessor->reindexList($productIds);
613623
}
614624

615625
/**
616-
* {@inheritdoc}
626+
* @inheritdoc
617627
*
618628
* @return $this
619629
*/
@@ -643,6 +653,7 @@ public function isRuleBehaviorChanged()
643653

644654
/**
645655
* Get array with data differences
656+
*
646657
* @param array $array1
647658
* @param array $array2
648659
*
@@ -664,6 +675,8 @@ protected function dataDiff($array1, $array2)
664675
}
665676

666677
/**
678+
* Getter for conditions field set ID
679+
*
667680
* @param string $formName
668681
* @return string
669682
*/
@@ -672,82 +685,80 @@ public function getConditionsFieldSetId($formName = '')
672685
return $formName . 'rule_conditions_fieldset_' . $this->getId();
673686
}
674687

675-
//@codeCoverageIgnoreStart
676-
677688
/**
678-
* {@inheritdoc}
689+
* @inheritdoc
679690
*/
680691
public function getRuleId()
681692
{
682693
return $this->getData(self::RULE_ID);
683694
}
684695

685696
/**
686-
* {@inheritdoc}
697+
* @inheritdoc
687698
*/
688699
public function setRuleId($ruleId)
689700
{
690701
return $this->setData(self::RULE_ID, $ruleId);
691702
}
692703

693704
/**
694-
* {@inheritdoc}
705+
* @inheritdoc
695706
*/
696707
public function getName()
697708
{
698709
return $this->getData(self::NAME);
699710
}
700711

701712
/**
702-
* {@inheritdoc}
713+
* @inheritdoc
703714
*/
704715
public function setName($name)
705716
{
706717
return $this->setData(self::NAME, $name);
707718
}
708719

709720
/**
710-
* {@inheritdoc}
721+
* @inheritdoc
711722
*/
712723
public function getDescription()
713724
{
714725
return $this->getData(self::DESCRIPTION);
715726
}
716727

717728
/**
718-
* {@inheritdoc}
729+
* @inheritdoc
719730
*/
720731
public function setDescription($description)
721732
{
722733
return $this->setData(self::DESCRIPTION, $description);
723734
}
724735

725736
/**
726-
* {@inheritdoc}
737+
* @inheritdoc
727738
*/
728739
public function getIsActive()
729740
{
730741
return $this->getData(self::IS_ACTIVE);
731742
}
732743

733744
/**
734-
* {@inheritdoc}
745+
* @inheritdoc
735746
*/
736747
public function setIsActive($isActive)
737748
{
738749
return $this->setData(self::IS_ACTIVE, $isActive);
739750
}
740751

741752
/**
742-
* {@inheritdoc}
753+
* @inheritdoc
743754
*/
744755
public function getRuleCondition()
745756
{
746757
return $this->getRuleConditionConverter()->arrayToDataModel($this->getConditions()->asArray());
747758
}
748759

749760
/**
750-
* {@inheritdoc}
761+
* @inheritdoc
751762
*/
752763
public function setRuleCondition($condition)
753764
{
@@ -758,70 +769,72 @@ public function setRuleCondition($condition)
758769
}
759770

760771
/**
761-
* {@inheritdoc}
772+
* @inheritdoc
762773
*/
763774
public function getStopRulesProcessing()
764775
{
765776
return $this->getData(self::STOP_RULES_PROCESSING);
766777
}
767778

768779
/**
769-
* {@inheritdoc}
780+
* @inheritdoc
770781
*/
771782
public function setStopRulesProcessing($isStopProcessing)
772783
{
773784
return $this->setData(self::STOP_RULES_PROCESSING, $isStopProcessing);
774785
}
775786

776787
/**
777-
* {@inheritdoc}
788+
* @inheritdoc
778789
*/
779790
public function getSortOrder()
780791
{
781792
return $this->getData(self::SORT_ORDER);
782793
}
783794

784795
/**
785-
* {@inheritdoc}
796+
* @inheritdoc
786797
*/
787798
public function setSortOrder($sortOrder)
788799
{
789800
return $this->setData(self::SORT_ORDER, $sortOrder);
790801
}
791802

792803
/**
793-
* {@inheritdoc}
804+
* @inheritdoc
794805
*/
795806
public function getSimpleAction()
796807
{
797808
return $this->getData(self::SIMPLE_ACTION);
798809
}
799810

800811
/**
801-
* {@inheritdoc}
812+
* @inheritdoc
802813
*/
803814
public function setSimpleAction($action)
804815
{
805816
return $this->setData(self::SIMPLE_ACTION, $action);
806817
}
807818

808819
/**
809-
* {@inheritdoc}
820+
* @inheritdoc
810821
*/
811822
public function getDiscountAmount()
812823
{
813824
return $this->getData(self::DISCOUNT_AMOUNT);
814825
}
815826

816827
/**
817-
* {@inheritdoc}
828+
* @inheritdoc
818829
*/
819830
public function setDiscountAmount($amount)
820831
{
821832
return $this->setData(self::DISCOUNT_AMOUNT, $amount);
822833
}
823834

824835
/**
836+
* Get from date
837+
*
825838
* @return string
826839
*/
827840
public function getFromDate()
@@ -830,6 +843,8 @@ public function getFromDate()
830843
}
831844

832845
/**
846+
* Get to date
847+
*
833848
* @return string
834849
*/
835850
public function getToDate()
@@ -838,7 +853,7 @@ public function getToDate()
838853
}
839854

840855
/**
841-
* {@inheritdoc}
856+
* @inheritdoc
842857
*
843858
* @return \Magento\CatalogRule\Api\Data\RuleExtensionInterface|null
844859
*/
@@ -848,7 +863,7 @@ public function getExtensionAttributes()
848863
}
849864

850865
/**
851-
* {@inheritdoc}
866+
* @inheritdoc
852867
*
853868
* @param \Magento\CatalogRule\Api\Data\RuleExtensionInterface $extensionAttributes
854869
* @return $this
@@ -859,6 +874,8 @@ public function setExtensionAttributes(RuleExtensionInterface $extensionAttribut
859874
}
860875

861876
/**
877+
* Getter for the rule condition converter
878+
*
862879
* @return Data\Condition\Converter
863880
* @deprecated 100.1.0
864881
*/
@@ -871,8 +888,6 @@ private function getRuleConditionConverter()
871888
return $this->ruleConditionConverter;
872889
}
873890

874-
//@codeCoverageIgnoreEnd
875-
876891
/**
877892
* @inheritDoc
878893
*/

app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,27 @@ public function testAfterDelete()
311311
}
312312

313313
/**
314-
* Test after update action
314+
* Test after update action for inactive rule
315315
*
316316
* @return void
317317
*/
318-
public function testAfterUpdate()
318+
public function testAfterUpdateInactive()
319319
{
320320
$this->rule->isObjectNew(false);
321+
$this->rule->setIsActive(0);
322+
$this->_ruleProductProcessor->expects($this->never())->method('getIndexer');
323+
$this->rule->afterSave();
324+
}
325+
326+
/**
327+
* Test after update action for active rule
328+
*
329+
* @return void
330+
*/
331+
public function testAfterUpdateActive()
332+
{
333+
$this->rule->isObjectNew(false);
334+
$this->rule->setIsActive(1);
321335
$indexer = $this->createMock(\Magento\Framework\Indexer\IndexerInterface::class);
322336
$indexer->expects($this->once())->method('invalidate');
323337
$this->_ruleProductProcessor->expects($this->once())->method('getIndexer')->will($this->returnValue($indexer));

app/code/Magento/Customer/Model/Indexer/Source.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getIterator()
9696
{
9797
$this->customerCollection->setPageSize($this->batchSize);
9898
$lastPage = $this->customerCollection->getLastPageNumber();
99-
$pageNumber = 0;
99+
$pageNumber = 1;
100100
do {
101101
$this->customerCollection->clear();
102102
$this->customerCollection->setCurPage($pageNumber);

app/code/Magento/MediaStorage/Service/ImageResize.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ public function resizeFromThemes(array $themes = null): \Generator
183183
$mediastoragefilename = $this->imageConfig->getMediaPath($originalImageName);
184184
$originalImagePath = $this->mediaDirectory->getAbsolutePath($mediastoragefilename);
185185

186+
if ($this->fileStorageDatabase->checkDbUsage()) {
187+
$this->fileStorageDatabase->saveFileToFilesystem($mediastoragefilename);
188+
}
186189
if ($this->mediaDirectory->isFile($originalImagePath)) {
187190
foreach ($viewImages as $viewImage) {
188-
if ($this->fileStorageDatabase->checkDbUsage()) {
189-
$this->fileStorageDatabase->saveFileToFilesystem($mediastoragefilename);
190-
}
191191
$this->resize($viewImage, $originalImagePath, $originalImageName);
192192
}
193193
} else {

app/code/Magento/Sales/etc/adminhtml/system.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
</field>
9393
<field id="amount" translate="label comment" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
9494
<label>Minimum Amount</label>
95+
<validate>validate-number validate-greater-than-zero</validate>
9596
<comment>Subtotal after discount</comment>
9697
</field>
9798
<field id="include_discount_amount" translate="label" sortOrder="12" type="select" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
@@ -135,6 +136,7 @@
135136
<label>Orders Cron Settings</label>
136137
<field id="delete_pending_after" translate="label" type="text" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
137138
<label>Pending Payment Order Lifetime (minutes)</label>
139+
<validate>validate-number validate-greater-than-zero</validate>
138140
</field>
139141
</group>
140142
</section>

0 commit comments

Comments
 (0)