Details
Description
Here is a part from the file with bug code.
Doctrine/ORM/Query/Parser.php
Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
// Fix order of identification variables. // They have to appear in the select clause in the same order as the // declarations (from ... x join ... y join ... z ...) appear in the query // as the hydration process relies on that order for proper operation. if ( count($this->_identVariableExpressions) > 1) { foreach ($this->_queryComponents as $dqlAlias => $qComp) { if (isset($this->_identVariableExpressions[$dqlAlias])) { $expr = $this->_identVariableExpressions[$dqlAlias]; $key = array_search($expr, $AST->selectClause->selectExpressions); unset($AST->selectClause->selectExpressions[$key]); $AST->selectClause->selectExpressions[] = $expr; } } }
Bug details
Doctrine/ORM/Query/Parser.php
Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
$key = array_search($expr, $AST->selectClause->selectExpressions);
unset($AST->selectClause->selectExpressions[$key]);
When array_search function return false (no match).
Then on the next line wrong array element deleted, because (int) false = 0
}:-[
Issue Links
- relates to
-
DDC-736
Nasty ordering issue with fetch-joins
-
Add test, this issue does not appear anymore with the fix for
DDC-915.