From d7d0ac1e73a6b122140e991adc19b8d97e5e42de Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 24 Aug 2012 10:50:39 +1200 Subject: [PATCH] FIXED: Simplified code --- code/model/Translatable.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/code/model/Translatable.php b/code/model/Translatable.php index 0d98d8e..7c852fb 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -1174,17 +1174,7 @@ class Translatable extends DataExtension implements PermissionProvider { // This is similar to the creation of objects via createTranslation, // although by default this object should not be saved $this->owner->update($stagingConfig->toMap()); - - // Copy translation group - // @todo Candidate for a refactor, along with other parts of this code - // that reference _TranslationGroupID / getTranslationGroup - if($group = $stagingConfig->getTranslationGroup()) { - $this->owner->_TranslationGroupID = $group; - } elseif(!empty($stagingConfig->_TranslationGroupID)) { - $this->owner->_TranslationGroupID = $stagingConfig->_TranslationGroupID; - } else { - $this->owner->_TranslationGroupID = $stagingConfig->ID; - } + $this->owner->_TranslationGroupID = $existingConfig->getTranslationGroup(); } /**