Index: plupload.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/plupload/plupload.module,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 plupload.module
--- plupload.module	22 Oct 2010 18:57:36 -0000	1.1.2.3
+++ plupload.module	23 Oct 2010 03:48:28 -0000
@@ -81,8 +81,10 @@
   drupal_add_js($path . '/plupload/src/javascript/plupload.html5.js');
   drupal_add_js($path . '/plupload/src/javascript/jquery.plupload.queue.js');
   drupal_add_css($path .'/plupload/examples/css/plupload.queue.css');
+  $query_string = $_GET;
+  unset($query_string['q']);
   
-  $url = url('plupload-pernode');
+  $url = url('plupload-pernode', array('query' => $query_string));
   $script = <<<__RSD__
 // Convert divs to queue widgets when the DOM is ready
  $(function() {
@@ -174,8 +176,17 @@
 
   // Move it to it's final home.
   $path = file_directory_path();
+  
+  // Pull off all the options from the query string for later attachment to the node.
+  $options = array();
+  foreach (array_keys($_GET) as $k) {
+    $pos = strpos($k, 'node_');
+    if ($pos === 0) {
+      $options[substr($k, 5)] = $_GET[$k];
+    }
+  }
 
-  $image_node = plupload_imagefield_create_node_from($temp_directory . DIRECTORY_SEPARATOR . $file_name, $file_name);
+  $image_node = plupload_imagefield_create_node_from($temp_directory . DIRECTORY_SEPARATOR . $file_name, $file_name, $options);
 
   // @todo check the $image_node and do some error handling.
   
@@ -194,7 +205,7 @@
  * @return $node
  *   a node object.
  */
-function plupload_imagefield_create_node_from($temp_filepath, $file_name) {
+function plupload_imagefield_create_node_from($temp_filepath, $file_name, $options) {
   // Only get files from Drupal's tmp directory.
   $directory = file_directory_temp();
   if (file_check_location($temp_filepath, $directory)) {
@@ -239,7 +250,7 @@
       // Save the file and create a node.
       if ($file = field_file_save_file($temp_filepath, $validators, $directory)) {
         $file['original_path'] = $temp_filepath;
-        $node = _plupload_imagefield_import_create_node($field, $form_state_values, $file);
+        $node = _plupload_imagefield_import_create_node($field, $form_state_values, $file, $options);
         file_delete($temp_filepath);
       }
     }
@@ -253,7 +264,7 @@
  * Create a new node with an attached image file.
  * Largely copied from imagefield_import.
  */
-function _plupload_imagefield_import_create_node($field, $form_state_values, $file = NULL) {
+function _plupload_imagefield_import_create_node($field, $form_state_values, $file = NULL, $options) {
   global $user;
 
   module_load_include('inc', 'node', 'node.pages');
@@ -274,9 +285,9 @@
 
   // Make it easy for other modules to add data to imported nodes using
   // hook_form_alter (@see http://drupal.org/node/714550).
-  foreach (array_keys($form_state_values) as $key) {
+  foreach (array_keys($options) as $key) {
     if (!isset($node->$key)) {
-      $node->$key = $form_state_values[$key];
+      $node->$key = $options[$key];
     }
   }
 
