From 014f05a5f05368b49200903fc406366751a4e3b8 Mon Sep 17 00:00:00 2001 From: Priyashantha Date: Tue, 5 Jun 2018 18:03:12 +0530 Subject: [PATCH] keep the previous code as it is and return in if condition --- code/model/Translatable.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/code/model/Translatable.php b/code/model/Translatable.php index ad5b7df..0710d27 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -1731,20 +1731,20 @@ class Translatable extends DataExtension implements PermissionProvider && count($controller->getRequest()->getVars()) ) { $tags .= ''; - } else { - $template = '' . "\n"; - $translations = $this->owner->getTranslations(); - if($translations->count()) { - $translations = $translations->toArray(); - $translations[] = $this->owner; + return; + } + $template = '' . "\n"; + $translations = $this->owner->getTranslations(); + if($translations->count()) { + $translations = $translations->toArray(); + $translations[] = $this->owner; - foreach($translations as $translation) { - $tags .= sprintf($template, - Convert::raw2xml($translation->Title), - i18n::convert_rfc1766($translation->Locale), - $translation->AbsoluteLink() - ); - } + foreach($translations as $translation) { + $tags .= sprintf($template, + Convert::raw2xml($translation->Title), + i18n::convert_rfc1766($translation->Locale), + $translation->AbsoluteLink() + ); } } }