? .cvsignore
? attachments_multiple_files.patch
? attachments_multiple_files2.patch
? privatemsg.attachment.patch
? privatemsg_attachments-1.tar.gz
? privatemsg_attachments_2.tar.gz
? privatemsg_attachments_3.tar.gz
? privatemsg_attachments_4.patch
? privatemsg_attachments_4.tar.gz
? privatemsg_attachments_permission_fix.patch
? privatemsg_attachments_private_fix.patch
Index: privatemsg.pages.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.pages.inc,v
retrieving revision 1.4
diff -u -p -r1.4 privatemsg.pages.inc
--- privatemsg.pages.inc	6 Jun 2010 15:13:47 -0000	1.4
+++ privatemsg.pages.inc	15 Jun 2010 07:52:28 -0000
@@ -387,6 +387,9 @@ function privatemsg_new_validate($form, 
  * Submit callback for the privatemsg_new form.
  */
 function privatemsg_new_submit($form, &$form_state) {
+  // Clear form_state storage so that it does not rebuild.
+  $form_state['storage'] = NULL;
+
   $status = _privatemsg_send($form_state['validate_built_message']);
   // Load usernames to which the message was sent to.
   $recipient_names = array();
Index: privatemsg_attachments/privatemsg_attachments.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg_attachments/privatemsg_attachments.module,v
retrieving revision 1.4
diff -u -p -r1.4 privatemsg_attachments.module
--- privatemsg_attachments/privatemsg_attachments.module	5 May 2010 20:54:19 -0000	1.4
+++ privatemsg_attachments/privatemsg_attachments.module	15 Jun 2010 07:52:29 -0000
@@ -58,8 +58,8 @@ function privatemsg_attachments_form_pri
     }
     else {
       $files = array();
-      if (!empty($form_state['values']['files'])) {
-        $files = $form_state['values']['files'];
+      if (!empty($form_state['storage']['files'])) {
+        $files = $form_state['storage']['files'];
         $form['privatemsg']['attachments']['#collapsed'] = FALSE;
       }
 
@@ -159,8 +159,6 @@ function privatemsg_attachments_menu() {
  * Menu-callback for JavaScript-based uploads.
  */
 function privatemsg_attachments_upload_js() {
-  $files = array();
-
   $form_state = array('values' => $_POST, 'storage' => NULL, 'submitted' => FALSE);
   // Load the form from the Form API cache.
   if (!($cached_form = form_get_cache($_POST['form_build_id'], $form_state)) || !isset($cached_form['privatemsg']['attachments'])) {
@@ -171,16 +169,18 @@ function privatemsg_attachments_upload_j
     exit();
   }
 
-  // Handle new uploads, and merge tmp files into node-files.
+  // Handle new uploads, and merge tmp files.
   _privatemsg_attachments_upload_submit($cached_form, $form_state);
 
   if (!empty($form_state['values']['files'])) {
     foreach ($form_state['values']['files'] as $fid => $file) {
-      $files[$fid] = $file;
+      if (isset($form_state['storage']['files'][$fid])) {
+        $form_state['values']['files'][$fid] = $form_state['storage']['files'][$fid];
+      }
     }
   }
-
-  $form = _privatemsg_attachments_form($files);
+  $form_state['storage']['files'] = $form_state['values']['files'];
+  $form = _privatemsg_attachments_form($form_state['values']['files']);
 
   unset($cached_form['privatemsg']['attachments']['wrapper']['new']);
   $cached_form['privatemsg']['attachments']['wrapper'] = array_merge($cached_form['privatemsg']['attachments']['wrapper'], $form);
@@ -189,7 +189,7 @@ function privatemsg_attachments_upload_j
 
   form_set_cache($_POST['form_build_id'], $cached_form, $form_state);
 
-  foreach ($files as $fid => $file) {
+  foreach ($form_state['values']['files'] as $fid => $file) {
     if (is_numeric($fid)) {
       $form['files'][$fid]['description']['#default_value'] = $form_state['values']['files'][$fid]['description'];
       $form['files'][$fid]['list']['#default_value'] = !empty($form_state['values']['files'][$fid]['list']);
Index: privatemsg_filter/privatemsg_filter.test
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg_filter/privatemsg_filter.test,v
retrieving revision 1.5
diff -u -p -r1.5 privatemsg_filter.test
--- privatemsg_filter/privatemsg_filter.test	5 May 2010 20:56:19 -0000	1.5
+++ privatemsg_filter/privatemsg_filter.test	15 Jun 2010 07:52:29 -0000
@@ -288,7 +288,7 @@ class PrivatemsgTagsTestCase extends Dru
     $thread_id2 = $response['message']['thread_id'];
 
     $this->drupalGet('messages');
-    $rows = $this->xpath('//tr');
+    $rows = $this->xpath('//tbody/tr');
     foreach ($rows as $row) {
       if ($row->td[2]->a == $subject1) {
         // The first thread should have both tags.
@@ -306,7 +306,7 @@ class PrivatemsgTagsTestCase extends Dru
       'tag-add' => 3,
     );
     $this->drupalPost(NULL, $add_tag, t('Apply Tag'));
-    $rows = $this->xpath('//tr');
+    $rows = $this->xpath('//tbody/tr');
     foreach ($rows as $row) {
       if ($row->td[2]->a == $subject1) {
         // The first thread should have both tags.
@@ -325,7 +325,7 @@ class PrivatemsgTagsTestCase extends Dru
       'tag-remove' => 3,
     );
     $this->drupalPost(NULL, $remove_tag, t('Remove Tag'));
-    $rows = $this->xpath('//tr');
+    $rows = $this->xpath('//tbody/tr');
     foreach ($rows as $row) {
       if ($row->td[2]->a == $subject1) {
         // The first thread should have only one tag now.
