Adding a bulk manager to a modelAdmin like this:
use Colymba\BulkManager;
class FAQAdmin extends ModelAdmin
{
public function getEditForm($id = null, $fields = null)
{
$form = parent::getEditForm($id, $fields);
$gridField = $form->Fields()->dataFieldByName($this->sanitiseClassName($this->modelClass));
$gridField->getConfig()->addComponent(new \Colymba\BulkManager\BulkManager());
$gridField->getConfig()->getComponentByType('\Colymba\BulkManager\BulkManager')->removeBulkAction(\Colymba\BulkAction\UnlinkHandler::class);
}
}
I get error:
Bulk action 'Colymba\BulkAction\UnlinkHandler' or '' doesn't exists.
How can I add and remove the actions the bulk editor offers? I only want the publish action.
Looking at the relevent class the namespace is:
and the classname is:
So after quite a bit of trial and error, I got this working with:
Which with hindsight is pretty obvious.