mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG FIX: $basetable moved to avoid errors
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72939 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
63bd9614d5
commit
30cd13f0af
@ -776,8 +776,9 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
|
||||
|
||||
// New records have their insert into the base data table done first, so that they can pass the
|
||||
// generated primary key on to the rest of the manipulation
|
||||
$baseTable = $ancestry[0];
|
||||
|
||||
if((!isset($this->record['ID']) || !$this->record['ID']) && isset($ancestry[0])) {
|
||||
$baseTable = $ancestry[0];
|
||||
|
||||
DB::query("INSERT INTO \"{$baseTable}\" (\"Created\") VALUES (" . DB::getConn()->now() . ")");
|
||||
$this->record['ID'] = DB::getGeneratedID($baseTable);
|
||||
|
Loading…
Reference in New Issue
Block a user