? .svn
? images/.svn
? images/mime/.svn
? js/.svn
Index: swfupload.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/swfupload/swfupload.module,v
retrieving revision 1.17
diff -u -p -r1.17 swfupload.module
--- swfupload.module	3 May 2010 19:47:52 -0000	1.17
+++ swfupload.module	7 May 2010 20:25:11 -0000
@@ -228,10 +228,17 @@ function swfupload_add_js($element) {
     $field['widget']['description_field'] = $field['description_field'];
   
     $limit = ($field['multiple'] == 1 ? 0 : ($field['multiple'] == 0 ? 1 : $field['multiple']));
-  
+
+    // We need to store the variable $flash_url statically while the 2nd time the script is loaded,
+    // $swfupload_library->scripts['2.2.0.1'] will be empty.
+    static $flash_url;
+    if (!$flash_url) {
+      $flash_url = base_path() . str_replace('.js', '.swf', array_shift($swfupload_library->scripts['2.2.0.1']));
+    }
+
     $settings['swfupload_settings'][$element['#id']] = array(
       'module_path' => $path,
-      'flash_url' => base_path() . str_replace('.js', '.swf', array_shift($swfupload_library->scripts['2.2.0.1'])),
+      'flash_url' => $flash_url,
       'upload_url' => url('swfupload'),  // Relative to the SWF file
       'upload_button_id' => $element['#id'],
       'file_post_name' => $element['#name'],
