Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix translations of associative conditions (OR, AND...) #70

Merged
merged 1 commit into from

2 participants

@CauanCabral

Before that change, relative code block has never executed.

@k1LoW k1LoW merged commit e3d05a5 into ichikaway:cake2.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 8 deletions.
  1. +7 −8 Model/Behavior/SqlCompatibleBehavior.php
View
15 Model/Behavior/SqlCompatibleBehavior.php
@@ -205,6 +205,12 @@ protected function _translateConditions(Model &$Model, &$conditions) {
$return = true;
continue;
}
+ if (is_numeric($key) && is_array($value)) {
+ if ($this->_translateConditions($Model, $value)) {
+ $return = true;
+ continue;
+ }
+ }
if (substr($uKey, -3) === 'NOT') {
// 'Special' case because it's awkward
$childKey = key($value);
@@ -247,17 +253,10 @@ protected function _translateConditions(Model &$Model, &$conditions) {
$return = true;
continue;
}
-
if (!in_array(substr($key, -1), array('>', '<', '='))) {
$return = true;
continue;
}
- if (is_numeric($key && is_array($value))) {
- if ($this->_translateConditions($Model, $value)) {
- $return = true;
- continue;
- }
- }
$parts = explode(' ', $key);
$operator = array_pop($parts);
if ($operator = $this->_translateOperator($Model, $operator)) {
@@ -292,4 +291,4 @@ protected function _translateOperator(Model $Model, $operator) {
}
return '';
}
-}
+}
Something went wrong with that request. Please try again.