mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-09-29 20:59:05 +02:00
BUG Add some exist check for tabsets which may not be there (#2079)
This commit is contained in:
parent
1db01ecce6
commit
07e70148da
@ -37,10 +37,13 @@ class SiteTreeFileFormFactoryExtension extends DataExtension
|
|||||||
$usedOnField->setDescription($backlinkHTML);
|
$usedOnField->setDescription($backlinkHTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add field to new tab
|
|
||||||
$tab = Tab::create('Usage', _t(__CLASS__.'.USAGE', 'Usage'), $usedOnField);
|
|
||||||
/** @var TabSet $tabset */
|
/** @var TabSet $tabset */
|
||||||
$tabset = $fields->fieldByName('Editor');
|
$tabset = $fields->fieldByName('Editor');
|
||||||
|
if ($tabset) {
|
||||||
|
// Add field to new tab
|
||||||
|
/** @var Tab $tab */
|
||||||
|
$tab = Tab::create('Usage', _t(__CLASS__.'.USAGE', 'Usage'), $usedOnField);
|
||||||
$tabset->push($tab);
|
$tabset->push($tab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user