From 3c92a32e5bff8a47328ad97d9508c792d3104d63 Mon Sep 17 00:00:00 2001
From: Jaime Herencia <jherencia@360690.no-reply.drupal.org>
Date: Thu, 9 Aug 2012 01:03:38 +0200
Subject: [PATCH] Issue #1719838 by jherencia: IEF table id is used more than
 once which breaks nested IEF forms dragabble behavior

---
 inline_entity_form.module |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/inline_entity_form.module b/inline_entity_form.module
index 393cb26..f225bae 100644
--- a/inline_entity_form.module
+++ b/inline_entity_form.module
@@ -979,13 +979,14 @@ function theme_inline_entity_form_entity_table($variables) {
   }
 
   if (!empty($rows)) {
+    $id = 'ief-entity-table-' . $form['#id'];
     if ($has_tabledrag) {
       // Add the tabledrag JavaScript.
-      drupal_add_tabledrag('ief-entity-table', 'order', 'sibling', 'ief-entity-delta');
+      drupal_add_tabledrag($id, 'order', 'sibling', 'ief-entity-delta');
     }
 
     // Return the themed table.
-    return theme('table', array('header' => $header, 'rows' => $rows, 'sticky' => FALSE, 'attributes' => array('id' => 'ief-entity-table')));
+    return theme('table', array('header' => $header, 'rows' => $rows, 'sticky' => FALSE, 'attributes' => array('id' => $id)));
   }
 }
 
-- 
1.7.5.4

