Details
Description
In he method "processParameterValue" in the class Doctrine\ORM\Query line 303, a "for" loop is use for construct the parameter query.
But if in the query parameter we pass a key=>value array, the method throw an error.
A little example :
$aId = array(0 => "Paris", 3 => "Canne", 9 => "St Julien");
$dql = $this->_em->createQueryBuilder();
$dql->select('c.ID')
->from('BOD\ModelBundle\Entity\City', 'c')
->where('c.IC IN (:cityIDs)')
->setParameter('cityIDs', $aId);
return $dql->getQuery()->execute();
The method "processParameterValue" throw an error because he don't found the index 1.
But if we replace the "for" loop by a foreach in Doctrine\ORM\Query::processParameterValue() :
foreach ($value as $keyValue => $oneValue) {
$paramValue = $this->processParameterValue($oneValue);
// TODO: What about Entities that have composite primary key?
$value[$keyValue] = is_array($paramValue) ? $paramValue[key($paramValue)] : $paramValue;
}
It work really fine.
I remain at your disposal for any further information.
Thanks for all!
Activity
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Benjamin Eberlei [ beberlei ] | Fabio B. Silva [ fabio.bat.silva ] |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 2.3 [ 10185 ] | |
| Resolution | Fixed [ 1 ] |
| Workflow | jira [ 13520 ] | jira-feedback [ 15270 ] |
| Workflow | jira-feedback [ 15270 ] | jira-feedback2 [ 17134 ] |
| Workflow | jira-feedback2 [ 17134 ] | jira-feedback3 [ 19387 ] |
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1697, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Fixed by : https://github.com/doctrine/doctrine2/commit/8a52e3033b51f0f0b97e1ee75477644484debf2b