Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

BUGFIX: GridField delete icon now correctly deletes, rather than alwa…

…ys just unlinking (Fixes 7801)

Fixes the handleAction function of GridFieldDeleteAction which wasn't differentiating between a 'deleterecord' action and an 'unlinkrelation' action.

  • Loading branch information...
1 parent af2eae7 commit 9a8313dce05d27279675680f1504783d5d61432d @purplespider purplespider committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 forms/gridfield/GridFieldDeleteAction.php
6 forms/gridfield/GridFieldDeleteAction.php
@@ -133,7 +133,11 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat
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);
+ }

1 comment on commit 9a8313d


HI, the remove function deletes the related entry, but keeps the relatio of it in the relation table. THis is not how it should be I guess.
v 3.03

Please sign in to comment.
Something went wrong with that request. Please try again.