mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: GridField delete icon now correctly deletes, rather than always just unlinking (Fixes 7801)
Fixes the handleAction function of GridFieldDeleteAction which wasn't differentiating between a 'deleterecord' action and an 'unlinkrelation' action. Fixes http://open.silverstripe.org/ticket/7801
This commit is contained in:
parent
af2eae760f
commit
9a8313dce0
@ -133,7 +133,11 @@ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_Actio
|
||||
if($actionName == 'deleterecord' && !$item->canDelete()) {
|
||||
throw new ValidationException(_t('GridFieldAction_Delete.DeletePermissionsFailure',"No delete permissions"),0);
|
||||
}
|
||||
$gridField->getList()->remove($item);
|
||||
if($actionName == 'deleterecord') {
|
||||
$item->delete();
|
||||
} else {
|
||||
$gridField->getList()->remove($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user