Commit 9cf185c3 authored by Dries's avatar Dries
Browse files

- Patch #852362 by chx: fixed extend is 100% fubar.

parent 74419892
...@@ -646,7 +646,7 @@ protected function expandArguments(&$query, &$args) { ...@@ -646,7 +646,7 @@ protected function expandArguments(&$query, &$args) {
* @return string * @return string
* The name of the class that should be used for this driver. * The name of the class that should be used for this driver.
*/ */
protected function getDriverClass($class) { public function getDriverClass($class) {
if (empty($this->driverClasses[$class])) { if (empty($this->driverClasses[$class])) {
$this->driverClasses[$class] = $class . '_' . $this->driver(); $this->driverClasses[$class] = $class . '_' . $this->driver();
if (!class_exists($this->driverClasses[$class])) { if (!class_exists($this->driverClasses[$class])) {
......
...@@ -601,11 +601,8 @@ public function havingCompile(DatabaseConnection $connection) { ...@@ -601,11 +601,8 @@ public function havingCompile(DatabaseConnection $connection) {
/* Implementations of QueryExtendableInterface. */ /* Implementations of QueryExtendableInterface. */
public function extend($extender_name) { public function extend($extender_name) {
$override_class = $this->connection->driver(); $class = $this->connection->getDriverClass($extender_name);
if (class_exists($override_class)) { return new $class($this, $this->connection);
$extender_name = $override_class;
}
return new $extender_name($this, $this->connection);
} }
/* Alter accessors to expose the query data to alter hooks. */ /* Alter accessors to expose the query data to alter hooks. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment