Open Fedik opened 4 years ago
Hi, check out https://github.com/doctrine/orm/pull/9010 it probably fixed this issue
@sztyup I just checked on 2.10.1, the bug still persists
doctrine/orm 3.2.2, the bug still persists
If you specify it like this, everything works. Yes, this condition inserts the value directly into the sql query, but it works.
foreach ($parameters as $parameter) {
[$name, $value, $operator] = $parameter;
$field = $this->quoteStrategy->getColumnName($name, $targetClass, $this->platform);
if ($value === null && ($operator === Comparison::EQ || $operator === Comparison::NEQ)) {
$whereClauses[] = sprintf('te.%s %s NULL', $field, $operator === Comparison::EQ ? 'IS' : 'IS NOT');
} elseif ($operator === Comparison::IN) {
$whereClauses[] = sprintf('te.%s %s (%s)', $field, $operator, "'".implode("','", $value)."'");
} else {
$whereClauses[] = sprintf('te.%s %s ?', $field, $operator);
$params[] = $value;
$paramTypes[] = PersisterHelper::getTypeOfField($name, $targetClass, $this->em)[0];
}
}
Bug Report
Summary
I got an error while try to use
->matching($criteria);
within Many2Many association, whencriteria
containsIN
clause.And crash with:
I suspect it happen because ManyToManyPersister::loadCriteria() does not extract a parameters types.
How to reproduce
I have made a little TestCase:
Expected behavior
All should work without crash.