Fixes issue with Sql Server driver when loading fixtures

Sqlserver::describe is expecting a model object (Unlike other drivers which work with either a object or string). While this does work under normal conditions, it causes a "Trying to get property of non-object" notice when using fixtures. The same problem also causes the testLimitOffsetHack test to fail.

This change does a simple test to ensure that the $model variable is an object before trying to access a property of it. All SqlServer tests are now passing.
This commit is contained in:
Walther Lalk 2014-05-06 12:43:36 +02:00
parent d466e00644
commit 2dd3cecfaa

View file

@ -208,7 +208,7 @@ class Sqlserver extends DboSource {
} }
$fields = array(); $fields = array();
$schema = $model->schemaName; $schema = is_object($model) ? $model->schemaName : false;
$cols = $this->_execute( $cols = $this->_execute(
"SELECT "SELECT