mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #840 from halkyon/compositefield_assetadmin_warning
AssetAdmin: PHP warning trying to add empty values into CompositeField
This commit is contained in:
commit
2b20a02735
@ -240,14 +240,17 @@ JS
|
|||||||
$fields->push($tabs);
|
$fields->push($tabs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we only add buttons if they're available. User might not have permission and therefore
|
||||||
|
// the button shouldn't be available. Adding empty values into a ComposteField breaks template rendering.
|
||||||
|
$actionButtonsComposite = CompositeField::create()->addExtraClass('cms-actions-row');
|
||||||
|
if($uploadBtn) $actionButtonsComposite->push($uploadBtn);
|
||||||
|
if($addFolderBtn) $actionButtonsComposite->push($addFolderBtn);
|
||||||
|
if($syncButton) $actionButtonsComposite->push($syncButton);
|
||||||
|
|
||||||
// List view
|
// List view
|
||||||
$fields->addFieldsToTab('Root.ListView', array(
|
$fields->addFieldsToTab('Root.ListView', array(
|
||||||
$actionsComposite = CompositeField::create(
|
$actionsComposite = CompositeField::create(
|
||||||
CompositeField::create(
|
$actionButtonsComposite
|
||||||
$uploadBtn,
|
|
||||||
$addFolderBtn,
|
|
||||||
$syncButton //TODO: add this into a batch actions menu as in https://github.com/silverstripe/silverstripe-design/raw/master/Design/ss3-ui_files-manager-list-view.jpg
|
|
||||||
)->addExtraClass('cms-actions-row')
|
|
||||||
)->addExtraClass('cms-content-toolbar field'),
|
)->addExtraClass('cms-content-toolbar field'),
|
||||||
$gridField
|
$gridField
|
||||||
));
|
));
|
||||||
|
Loading…
Reference in New Issue
Block a user