Skip to content

Commit 79b74b6

Browse files
Stanislav Idolovadrian-martinez-interactiv4
authored andcommitted
Fixed typo and logic mismatch
1 parent 6771f36 commit 79b74b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/code/Magento/Rule/Model/Condition/AbstractCondition.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ public function __construct(Context $context, array $data = [])
8383

8484
$options = $this->getAttributeOptions();
8585
if ($options) {
86-
$this->setAttribute(key($options));
86+
$this->setAttribute(key(reset($options)));
8787
}
8888
$options = $this->getOperatorOptions();
8989
if ($options) {
90-
$this->setOperator(key($options));
90+
$this->setOperator(key(reset($options)));
9191
}
9292
}
9393

@@ -504,9 +504,9 @@ public function getTypeElementHtml()
504504
public function getAttributeElement()
505505
{
506506
if (null === $this->getAttribute()) {
507-
$options = $this->getAttributeOptions();
507+
$options = $this->getAttributeOption();
508508
if ($options) {
509-
$this->setAttribute(key($options));
509+
$this->setAttribute(key(reset($options)));
510510
}
511511
}
512512
return $this->getForm()->addField(
@@ -542,7 +542,7 @@ public function getOperatorElement()
542542
{
543543
$options = $this->getOperatorSelectOptions();
544544
if ($this->getOperator() === null) {
545-
$option = current($options);
545+
$option = current(reset($options));
546546
$this->setOperator($option['value']);
547547
}
548548

0 commit comments

Comments
 (0)