mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Check if object is folder before trying to add cms fields.
This commit is contained in:
parent
9b2183167f
commit
0fea48a608
@ -1065,6 +1065,7 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
$alreadyTranslatedLocales[$this->owner->Locale] = $this->owner->Locale;
|
||||
$alreadyTranslatedLocales = array_combine($alreadyTranslatedLocales, $alreadyTranslatedLocales);
|
||||
|
||||
if ($fields->hasTabSet()) {
|
||||
// Check if fields exist already to avoid adding them twice on repeat invocations
|
||||
$tab = $fields->findOrMakeTab('Root.Translations', _t('Translatable.TRANSLATIONS', 'Translations'));
|
||||
if(!$tab->fieldByName('CreateTransHeader')) {
|
||||
@ -1132,6 +1133,7 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateSettingsFields(&$fields) {
|
||||
$this->addTranslatableFields($fields);
|
||||
|
Loading…
Reference in New Issue
Block a user