Skip to content

Commit

Permalink
BUGFIX: fix to #110845 to allow parsing of the DataObject file in PHP…
Browse files Browse the repository at this point in the history
… 5.2 and below.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@110863 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Julian Seidenberg committed Sep 16, 2010
1 parent ed666b7 commit c32a6e3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/model/DataObject.php
Expand Up @@ -408,13 +408,10 @@ protected function duplicateManyManyRelations($sourceObject, $destinationObject)
// DO NOT copy has_many relations, because copying the relation would result in us changing the has_one relation
// on the other side of this relation to point at the copy and no longer the original (being a has_one, it can
// only point at one thing at a time). So, all relations except has_many can and are copied
if ($sourceObject::$has_one) foreach($sourceObject::$has_one as $name => $type) {
if ($sourceObject->has_one()) foreach($sourceObject->has_one() as $name => $type) {
$this->duplicateRelations($sourceObject, $destinationObject, $name);
}
if ($sourceObject::$many_many) foreach($sourceObject::$many_many as $name => $type) {
$this->duplicateRelations($sourceObject, $destinationObject, $name);
}
if ($sourceObject::$belongs_many_many) foreach($sourceObject::$belongs_many_many as $name => $type) {
if ($sourceObject->many_many()) foreach($sourceObject->many_many() as $name => $type) { //many_many include belongs_many_many
$this->duplicateRelations($sourceObject, $destinationObject, $name);
}

Expand Down

0 comments on commit c32a6e3

Please sign in to comment.