BUGFIX Fixed undefined index notice error in Database

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73615 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-03-25 03:17:19 +00:00
parent 3164b7ff67
commit 7db4f61c6c

View File

@ -1,4 +1,4 @@
<?php
l<?php
/**
* Abstract database connectivity class.
* Sub-classes of this implement the actual database connection libraries
@ -339,7 +339,7 @@ abstract class Database extends Object {
//TODO: this is starting to get extremely fragmented.
//There are two different versions of $spec floating around, and their content changes depending
//on how they are structured. This needs to be tidied up.
$fieldValue = null;
$newTable = false;
Profiler::mark('requireField');
@ -377,10 +377,12 @@ abstract class Database extends Object {
$specValue=DB::getConn()->IdColumn(true);
if(!$newTable) {
if(is_array($this->fieldList[$table][$field])) {
$fieldValue = $this->fieldList[$table][$field]['data_type'];
} else {
$fieldValue = $this->fieldList[$table][$field];
if(isset($this->fieldList[$table][$field])) {
if(is_array($this->fieldList[$table][$field])) {
$fieldValue = $this->fieldList[$table][$field]['data_type'];
} else {
$fieldValue = $this->fieldList[$table][$field];
}
}
}