Skip to content
Permalink
Browse files

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.
  • Loading branch information...
dakota committed May 6, 2014
1 parent d466e00 commit 2dd3cecfaa54dede0a3a5684b0944188c1fa2965
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -208,7 +208,7 @@ public function describe($model) {
}
$fields = array();
$schema = $model->schemaName;
$schema = is_object($model) ? $model->schemaName : false;
$cols = $this->_execute(
"SELECT

0 comments on commit 2dd3cec

Please sign in to comment.
You can’t perform that action at this time.