? prepopulate_all-forms-101916-11.patch
Index: prepopulate.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/prepopulate/prepopulate.module,v
retrieving revision 1.9
diff -u -p -r1.9 prepopulate.module
--- prepopulate.module	16 Mar 2008 14:27:18 -0000	1.9
+++ prepopulate.module	16 Mar 2008 15:19:03 -0000
@@ -16,7 +16,7 @@
 function prepopulate_help($path, $arg) {
   switch ($path) {
     case 'admin/modules#description':
-      return t('Pre-populates forms for allowed content types with HTTP GET data');
+      return t('Pre-populates forms with HTTP GET data');
       break;
   } // endswitch $section
 } // endfunction prepopulate_help()
@@ -25,34 +25,13 @@ function prepopulate_help($path, $arg) {
  * Implementation of hook_form_alter().
  */
 function prepopulate_form_alter(&$form, $form_state, $form_id) {
-  switch ($form_id) {
-    // Add our chekcbox to the content type edit forms
-    // (admin/content/node-type/$type).
-    case 'node_type_form':
-      $type = $form['#node_type']->type;
-      $form['workflow']['prepopulate_allowed'] = array(
-        '#type' => 'checkbox',
-        '#title' => 'Prepopulate form from URL?',
-        '#default_value' => variable_get('prepopulate_allowed_'. $type, TRUE),
-        '#description' => t('Allows fields to be prepopulated from the URL'),
-      );      
-    return;
-  } // endswitch $form_id
-
-  // Process the URL on a node add/edit form (node/add/$type).
-  if (isset($form['#node'])) {
-    $node = $form['#node'];
-    // Make sure this node type allows prepopulate and
-    // that we have a $_GET variable in the URL.
-    if (variable_get('prepopulate_allowed_'. $node->type, TRUE) && isset($_GET['edit'])) {
-      foreach (array_keys((array)$_GET['edit']) as $getvar) {
-        if (element_child($getvar) && !is_null($form[$getvar])) {
-          _prepopulate_get_walk($form[$getvar], $_GET['edit'][$getvar]);
-        }
-      } // endforeach get variable
-    } // endif any get vars
+  if (isset($_GET['edit'])) {
+    foreach (array_keys((array)$_GET['edit']) as $getvar) {
+      if (element_child($getvar) && !is_null($form[$getvar])) {
+        _prepopulate_get_walk($form[$getvar], $_GET['edit'][$getvar]);
+      }
+    }
   }
-  
 } // endfunction prepopulate_form_alter()
 
 /**
