BUG Add some exist check for tabsets which may not be there (#2079)

This commit is contained in:
Chris Joe 2018-01-31 10:45:31 +13:00 committed by Aaron Carlino
parent 1db01ecce6
commit 07e70148da

View File

@ -37,10 +37,13 @@ class SiteTreeFileFormFactoryExtension extends DataExtension
$usedOnField->setDescription($backlinkHTML);
}
// Add field to new tab
$tab = Tab::create('Usage', _t(__CLASS__.'.USAGE', 'Usage'), $usedOnField);
/** @var TabSet $tabset */
$tabset = $fields->fieldByName('Editor');
$tabset->push($tab);
if ($tabset) {
// Add field to new tab
/** @var Tab $tab */
$tab = Tab::create('Usage', _t(__CLASS__.'.USAGE', 'Usage'), $usedOnField);
$tabset->push($tab);
}
}
}