Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.0, 1.2.1
-
Fix Version/s: 1.2.4
-
Component/s: Connection, Query
-
Labels:None
Description
r6799 introduced 3 changes to the Doctrine_Table: in findByDql(), getQueryObject(), and createQuery() methods.
The first two are pretty obvious, but the last one is a mistake in my opinion:
--- lib/Doctrine/Table.php (revision 6798)
+++ lib/Doctrine/Table.php (revision 6799)
@@ -1033,7 +1033,7 @@
$class = $this->getAttribute(Doctrine_Core::ATTR_QUERY_CLASS);
- return Doctrine_Query::create($this->_conn, $class)
+ return Doctrine_Query::create(null, $class)
->from($this->getComponentName() . $alias);
}
An instance of Doctrine_Table always has a reference to a particular Doctrine_Connection, so why createQuery() method, intended to "create a query on this table" should use different (i.e. default one) connection instead of already specified one?
Attached test case.