Index: modules/field/modules/text/text.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.js,v
retrieving revision 1.3
diff -u -p -r1.3 text.js
--- modules/field/modules/text/text.js	8 Mar 2010 03:59:25 -0000	1.3
+++ modules/field/modules/text/text.js	9 Jun 2010 16:42:46 -0000
@@ -9,30 +9,40 @@ Drupal.behaviors.textSummary = {
   attach: function (context, settings) {
     $('.text-summary', context).once('text-summary', function () {
       var $widget = $(this).closest('div.field-type-text-with-summary');
-      var $summary = $widget.find('div.text-summary-wrapper');
-      var $summaryLabel = $summary.find('label');
-      var $full = $widget.find('.form-item:has(.text-full)');
-      var $fullLabel = $full.find('label');
+      var $summaries = $widget.find('div.text-summary-wrapper');
 
-      // Setup the edit/hide summary link.
-      var $link = $('<span class="field-edit-link">(<a class="link-edit-summary" href="#">' + Drupal.t('Hide summary') + '</a>)</span>').toggle(
-        function () {
-          $summary.hide();
-          $(this).find('a').html(Drupal.t('Edit summary')).end().appendTo($fullLabel);
-          return false;
-        },
-        function () {
-          $summary.show();
-          $(this).find('a').html(Drupal.t('Hide summary')).end().appendTo($summaryLabel);
-          return false;
+      $summaries.once('text-summary-wrapper').each(function(index) {
+        var $summary = $(this);
+        var $summaryLabel = $summary.find('label');
+        var $full = $widget.find('.text-full').eq(index).closest('.form-item');
+        var $fullLabel = $full.find('label');
+
+        // Create a placeholder label when the field cardinality is
+        // unlimited or greater than 1.
+        if ($fullLabel.length == 0) {
+          $fullLabel = $('<label></label>').prependTo($full);
         }
-      ).appendTo($summaryLabel);
 
-      // If no summary is set, hide the summary field.
-      if ($(this).val() == '') {
-        $link.click();
-      }
-      return;
+        // Setup the edit/hide summary link.
+        var $link = $('<span class="field-edit-link">(<a class="link-edit-summary" href="#">' + Drupal.t('Hide summary') + '</a>)</span>').toggle(
+          function () {
+            $summary.hide();
+            $(this).find('a').html(Drupal.t('Edit summary')).end().appendTo($fullLabel);
+            return false;
+          },
+          function () {
+            $summary.show();
+            $(this).find('a').html(Drupal.t('Hide summary')).end().appendTo($summaryLabel);
+            return false;
+          }
+        ).appendTo($summaryLabel);
+
+        // If no summary is set, hide the summary field.
+        if ($(this).val() == '') {
+          $link.click();
+        }
+        return;
+      });
     });
   }
 };
