Last active
October 12, 2018 20:10
-
-
Save sunnysideup/8d5a0a3dd35cf95b4f8dfab00f845f7f to your computer and use it in GitHub Desktop.
Fixing ModelAdmin in CWP 2.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Name: cwp-hacks | |
--- | |
SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor: | |
extensions: | |
- GridFieldConfig_RecordEditor_Fix | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use SilverStripe\Core\Extension; | |
use SilverStripe\Forms\GridField\GridField_ActionMenu; | |
use SilverStripe\Forms\GridField\GridFieldDeleteAction; | |
class GridFieldConfig_RecordEditor_Fix extends Extension | |
{ | |
function updateConfig() | |
{ | |
$this->owner->removeComponentsByType(GridFieldDeleteAction::class); | |
$this->owner->removeComponentsByType(GridField_ActionMenu::class); | |
$this->owner->addComponent(new GridFieldDeleteAction()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment