Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alex-bukach/97f41336e123f8b531003672fbc6e2f5 to your computer and use it in GitHub Desktop.
Save alex-bukach/97f41336e123f8b531003672fbc6e2f5 to your computer and use it in GitHub Desktop.
Variation of https://www.drupal.org/node/2853973 for the case when https://www.drupal.org/node/2853167 is already applied
diff --git a/src/Plugin/views/field/DraggableViewsField.php b/src/Plugin/views/field/DraggableViewsField.php
index bfade16..93c4420 100755
--- a/src/Plugin/views/field/DraggableViewsField.php
+++ b/src/Plugin/views/field/DraggableViewsField.php
@@ -62,7 +62,7 @@ class DraggableViewsField extends BulkForm {
// Item to keep id of the entity.
$form[$this->options['id']][$row_index]['id'] = array(
'#type' => 'hidden',
- '#value' => $row->{$this->definition['entity field']},
+ '#value' => $this->getEntity($row)->id(),
'#attributes' => array('class' => array('draggableviews-id')),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment