No description provided.
fixed combine overwrite exiting criterions.
This pull request passes (merged 740d8ff into 441f969).
Could you write a unit test to prove both your fix and the bug?
we sadly don't have any experience with unit tests yet, so it's probably for the best if we simply explain the problem a bit more, so that you can reproduce it by yourself
we have a pretty complex application with a behavior wo filters rows automatically by user credentials
our behavior adds the filter by credential method wich does something like this and it's called in preSelectQuery
$this->combine(array('user_type', 'credential'), 'and', 'user_type_credential');
$this->combine(array('user_type_credential', 'user_type2'), 'or');
now we have the use case that we want to filter the list a bit more wich works for filterByUsername fine ... but not for ->filterByUserType because it would be overridden by the combine.
if we would use first the combine and the filterByXXX after it would work because filterByXXX seems to use Criteria::addAnd while combine uses Criteria::add
added unit test to prove the call order of combine and filterByXXX ha…
…s influence on sql
i can confirm the issue and i wrote a unit test wich should prove that a filterByXXX before a combine gets overriden instead of added while a filterByXXX after a combine gets correclty added.
The unit test should fail without the first commit of @hholzer and work afterwards
Great, thank you!