Skip to content

Commit

Permalink
BUGFIX: Pass correct class to allowPrimaryKeyEditing in yaml fixture
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101171 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sam Minnee committed Feb 2, 2011
1 parent 5253803 commit f9836b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/model/YamlFixture.php
Expand Up @@ -178,9 +178,9 @@ protected function writeDataObject($dataClass, $items) {

// The database needs to allow inserting values into the foreign key column (ID in our case)
$conn = DB::getConn();
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing($dataClass, true);
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing(ClassInfo::baseDataClass($dataClass), true);
$obj->write(false, true);
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing($dataClass, false);
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing(ClassInfo::baseDataClass($dataClass), false);
}

// Populate the dictionary with the ID
Expand Down

0 comments on commit f9836b0

Please sign in to comment.