unclecheese / silverstripe-gridfield-betterbuttons

Adds new form actions and buttons to the GridField detail form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot remove actions of versiond data object detail form

Valandur opened this issue · comments

In a normal data object one can have a function such as:

public function getBetterButtonsActions() {
	return FieldList::create();
}

to clear all action buttons in the grid field detail form.

When using the same code for a versioned data object the default buttons "save", "publish", etc. remain, meaning one can only add new buttons, not remove existing ones.

This seems to be due to the difference in Controllers\ItemRequest.php where this code overwrites the buttons, whereas in Controllers\VersionedItemRequest this code only causes the buttons to be appended.

Why is there the difference in this behavior? And is there any way to change this and/or remove buttons from the gridfield detail form of versioned objects?