File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
app/code/Magento/Rule/Model/Condition/Sql Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -116,24 +116,26 @@ protected function _joinTablesToCollection(
116
116
protected function _getMappedSqlCondition (AbstractCondition $ condition , $ value = '' )
117
117
{
118
118
$ argument = $ condition ->getMappedSqlField ();
119
- if ($ argument ) {
120
- $ conditionOperator = $ condition ->getOperatorForValidate ();
121
119
122
- if (! isset ( $ this -> _conditionOperatorMap [ $ conditionOperator ] )) {
123
- throw new \ Magento \ Framework \ Exception \ LocalizedException ( __ ( ' Unknown condition operator ' ) );
124
- }
120
+ if (empty ( $ argument )) {
121
+ return $ this -> _expressionFactory -> create ([ ' expression ' => ' 1 = -1 ' ] );
122
+ }
125
123
126
- $ sql = str_replace (
127
- ':field ' ,
128
- $ this ->_connection ->getIfNullSql ($ this ->_connection ->quoteIdentifier ($ argument ), 0 ),
129
- $ this ->_conditionOperatorMap [$ conditionOperator ]
130
- );
124
+ $ conditionOperator = $ condition ->getOperatorForValidate ();
131
125
132
- return $ this ->_expressionFactory ->create (
133
- ['expression ' => $ value . $ this ->_connection ->quoteInto ($ sql , $ condition ->getBindArgumentValue ())]
134
- );
126
+ if (!isset ($ this ->_conditionOperatorMap [$ conditionOperator ])) {
127
+ throw new \Magento \Framework \Exception \LocalizedException (__ ('Unknown condition operator ' ));
135
128
}
136
- return '' ;
129
+
130
+ $ sql = str_replace (
131
+ ':field ' ,
132
+ $ this ->_connection ->getIfNullSql ($ this ->_connection ->quoteIdentifier ($ argument ), 0 ),
133
+ $ this ->_conditionOperatorMap [$ conditionOperator ]
134
+ );
135
+
136
+ return $ this ->_expressionFactory ->create (
137
+ ['expression ' => $ value . $ this ->_connection ->quoteInto ($ sql , $ condition ->getBindArgumentValue ())]
138
+ );
137
139
}
138
140
139
141
/**
You can’t perform that action at this time.
0 commit comments