Skip to content

Commit 43c542e

Browse files
author
Stanislav Idolov
committed
MAGETWO-70819: Widget with condition "special date to"
1 parent 1addf53 commit 43c542e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Rule/Model/Condition/Sql/Builder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ protected function _joinTablesToCollection(
108108
}
109109

110110
/**
111+
* Returns sql expression based on rule condition.
112+
*
111113
* @param AbstractCondition $condition
112114
* @param string $value
113115
* @return string
@@ -117,6 +119,7 @@ protected function _getMappedSqlCondition(AbstractCondition $condition, $value =
117119
{
118120
$argument = $condition->getMappedSqlField();
119121

122+
// If rule hasn't valid argument - create negative expression to prevent incorrect rule behavior.
120123
if (empty($argument)) {
121124
return $this->_expressionFactory->create(['expression' => '1 = -1']);
122125
}

0 commit comments

Comments
 (0)