From 130de1eace1cc3034cc157506920f818ea3072bb Mon Sep 17 00:00:00 2001 From: Christopher Darling Date: Tue, 15 Mar 2016 14:45:35 +0000 Subject: [PATCH] FIX: unique ID attribute for ManyRelationHandler ManyList version of https://github.com/MadeHQ/gridfieldrelationhandler/commit/1ab7bac94cc7bfb252fd839d345902f4c2f7f07c --- gridfield/GridFieldManyRelationHandler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gridfield/GridFieldManyRelationHandler.php b/gridfield/GridFieldManyRelationHandler.php index b8144ae..ce03d9e 100644 --- a/gridfield/GridFieldManyRelationHandler.php +++ b/gridfield/GridFieldManyRelationHandler.php @@ -18,7 +18,12 @@ public function getColumnContent($gridField, $record, $columnName) { $state = $this->getState($gridField); $checked = in_array($record->ID, $state->RelationVal->toArray()); - $field = array('Checked' => $checked, 'Value' => $record->ID, 'Name' => $this->relationName($gridField)); + $field = array( + 'Checked' => $checked, + 'Value' => $record->ID, + 'Name' => $this->relationName($gridField), + 'ID' => $record->ID + ); if($list instanceof HasManyList) { $key = $record->{$this->cheatList->getForeignKey($list)}; if($key && !$checked) {