Skip to content

Commit

Permalink
Merge pull request #11990 from CrNix/2.1.x-mergeFindParameters
Browse files Browse the repository at this point in the history
Fix for issue #11987 - merging conditions in manager.zep _mergeFindParameters method
  • Loading branch information
andresgutierrez authored Jul 19, 2016
2 parents a7d657c + 04b367a commit 6fd154a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
- Fixed incorrect query when using NULL fields with `Phalcon\Validation\Validator\Uniqueness`
- Fixed `Phalcon\Forms\Form::getValue`. Now Elements can have names that match with the internal Form getters [#10398](https://github.com/phalcon/cphalcon/issues/10398)
- Add `setContentLength()` method to `Phalcon\Http\Response`
- Fixed `Phalcon\Mvc\Model\Manager::_mergeFindParameters` - Merging conditions [#11987](https://github.com/phalcon/cphalcon/issues/11987)

# [2.0.13](https://github.com/phalcon/cphalcon/releases/tag/phalcon-v2.0.13) (2016-05-19)
- Restored `Phalcon\Text::camelize` behavior [#11767](https://github.com/phalcon/cphalcon/issues/11767)
Expand Down
8 changes: 4 additions & 4 deletions phalcon/mvc/model/manager.zep
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI
var key, value, findParams;

if typeof findParamsOne == "string" && typeof findParamsTwo == "string" {
return ["(" . findParamsOne . ") AND " . findParamsTwo];
return ["(" . findParamsOne . ") AND (" . findParamsTwo . ")"];
}

let findParams = [];
Expand All @@ -1141,7 +1141,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI
if !isset findParams[0] {
let findParams[0] = value;
} else {
let findParams[0] = "(" . findParams[0] . ") AND " . value;
let findParams[0] = "(" . findParams[0] . ") AND (" . value . ")";
}
continue;
}
Expand All @@ -1162,7 +1162,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI
if !isset findParams[0] {
let findParams[0] = value;
} else {
let findParams[0] = "(" . findParams[0] . ") AND " . value;
let findParams[0] = "(" . findParams[0] . ") AND (" . value . ")";
}
continue;
}
Expand All @@ -1187,7 +1187,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI
if !isset findParams[0] {
let findParams[0] = findParamsTwo;
} else {
let findParams[0] = "(" . findParams[0] . ") AND " . findParamsTwo;
let findParams[0] = "(" . findParams[0] . ") AND (" . findParamsTwo . ")";
}
}
}
Expand Down

0 comments on commit 6fd154a

Please sign in to comment.