FIXED: Simplified code

This commit is contained in:
Damian Mooyman 2012-08-24 10:50:39 +12:00 committed by Ingo Schommer
parent 91596197ee
commit 67915ea695

View File

@ -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();
}
/**