Ver Fonte

adding ahah_helper patch for submit issue, and notes in readme on how to apply it

alexgl há 13 anos atrás
pai
commit
ecb20cefbf

+ 20 - 0
base/tripal_views_integration/README.patches.txt

@@ -0,0 +1,20 @@
+This README lists all patches that were used in developement of tripal_views_integration.
+
+------------------------------------------------------
+These are the patches needed to ahah_helper module:
+Submit issue reported and solved here:
+http://drupal.org/node/1231140
+The original patch location:
+http://drupal.org/files/issues/1231140.ahah_helper.form-submit-handler.patch
+The patch file alexg used:
+patches/1231140.ahah_helper.form-submit-handler.patch
+Usage:
+1. Find the global or local path to this module and substitue in the command below for*path_to_tripal_views_integration*
+2. Navigate to the folder of contrib module ahah_helper and run:
+ahah_helper$ patch -p1 < *path_to_tripal_views_integration*/patches/1231140.ahah_helper.form-submit-handler.patch
+
+(alternatively you can just copy the patch file to the ahah_helper folder and run the command without *path_to_tripal_views_integration*)
+NOTE: we have to use patch -p1 command, since this is a git patch, and the ahah_helper folder most likely will not be
+	git inintialized. -p0 will not work. If folder is not git initialized then 'git apply -v *patchname*' will do nothing.
+-----------------------------------------------------
+

+ 6 - 9
base/tripal_views_integration/includes/tripal_views_integration.admin.inc

@@ -293,14 +293,13 @@ function tripal_views_integration_new_setup_form(&$form_state){
          );
          $i++;
       }
-
    }
+   
    $form['save'] = array(
-             '#type'  => 'submit',
-             '#value' => t('Save'),
-             '#executes_submit_callback' => TRUE,
+           '#type'  => 'submit',
+           '#value' => t('Save'),
    );
-   dpm($form, 'form at end of creating');
+
    return $form;
 }
 
@@ -309,9 +308,7 @@ function tripal_views_integration_new_setup_form(&$form_state){
  *
  * @ingroup tripal_views_integration
  */
-function tripal_views_integration_submit($form, &$form_state){
-	dpm($form, 'form');
-	drupal_set_message('Congratulations, you entered valid data. Unfortunately, nothing was saved because this is a demo.');
-	
+function tripal_views_integration_new_setup_form_submit($form, &$form_state){
 
 }
+

+ 18 - 0
base/tripal_views_integration/patches/1231140.ahah_helper.form-submit-handler.patch

@@ -0,0 +1,18 @@
+diff --git a/ahah_helper.module b/ahah_helper.module
+index dfd222a..32d5c5d 100644
+--- a/ahah_helper.module
++++ b/ahah_helper.module
+@@ -132,6 +132,13 @@ function ahah_helper_generic_submit($form, &$form_state) {
+  */
+ function ahah_helper_real_submit($form, &$form_state) {
+   unset($form_state['storage']);
++
++  // Call FormAPI's standard submit handler for the form.
++  $form_id = $form['form_id']['#value'];
++  $function = $form_id . '_submit';
++  if (function_exists($function)) {
++    $function($form, &$form_state);
++  }
+ }
+ 
+ /**