diff --git a/code/model/Translatable.php b/code/model/Translatable.php
index 124f52d..c1f754a 100755
--- a/code/model/Translatable.php
+++ b/code/model/Translatable.php
@@ -1069,22 +1069,24 @@ class Translatable extends DataExtension implements PermissionProvider {
_t('Translatable.EXISTING', 'Existing translations'),
3
));
- if(!$tab->fieldByName('existingtrans')) {
+ if (!$tab->fieldByName('existingtrans')) {
$existingTransHTML = '
';
- foreach($this->getTranslations() as $existingTranslation) {
- if($existingTranslation && $existingTranslation->hasMethod('CMSEditLink')) {
- $existingTransHTML .= sprintf(
- '- %s
',
- Controller::join_links(
- $existingTranslation->CMSEditLink(),
- '?locale='.$existingTranslation->Locale
- ),
- i18n::get_locale_name($existingTranslation->Locale)
- );
+ if ($existingTranslations = $this->getTranslations()) {
+ foreach ($existingTranslations as $existingTranslation) {
+ if ($existingTranslation && $existingTranslation->hasMethod('CMSEditLink')) {
+ $existingTransHTML .= sprintf(
+ '- %s
',
+ Controller::join_links(
+ $existingTranslation->CMSEditLink(),
+ '?locale=' . $existingTranslation->Locale
+ ),
+ i18n::get_locale_name($existingTranslation->Locale)
+ );
+ }
}
}
- $existingTransHTML .= '
';
- $tab->push(new LiteralField('existingtrans',$existingTransHTML));
+ $existingTransHTML .= '';
+ $tab->push(new LiteralField('existingtrans', $existingTransHTML));
}
}
}