The Node adding form doesn't create a node when you hit the Forward button, unless "Display submit button" is enabled.

Version: pageroute 6.x-1.x-dev 2009-10-01, Drupal 6.13, PHP 5.2.10.

Dave

Comments

sepgil’s picture

The simplest way to fix this would be:

Index: pageroute.page_add.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pageroute/pageroute.page_add.inc,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 pageroute.page_add.inc
--- pageroute.page_add.inc	30 Sep 2009 14:34:10 -0000	1.1.2.11
+++ pageroute.page_add.inc	7 Oct 2009 10:44:18 -0000
@@ -88,6 +88,6 @@
   }
 
   public static function getDefaultSubmitHandler($form) {
-    return $form['buttons']['submit']['#submit'][0];
+    return 'node_form_submit';//$form['buttons']['submit']['#submit'][0];
   }
 }

But I don't know if all content types uses node_form_submit as the default submit handler(I think at least all core content types uses that handler).

sepgil’s picture

Assigned: Unassigned » sepgil
Status: Active » Needs work

I solved the problem in a diffrent way:

Index: pageroute.page_edit.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pageroute/pageroute.page_edit.inc,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 pageroute.page_edit.inc
--- pageroute.page_edit.inc	30 Sep 2009 14:34:10 -0000	1.1.2.12
+++ pageroute.page_edit.inc	17 Oct 2009 11:38:30 -0000
@@ -62,6 +62,7 @@
       drupal_access_denied();
       pageroute_exit_now();
     }
+    $form['#options']['submit_handler'] = $form['buttons']['submit']['#submit'][0];
   }
 
   public function getAdminForm($page, &$form) {
@@ -122,7 +123,7 @@
   }
 
   public static function getDefaultSubmitHandler($form) {
-    return $form['buttons']['submit']['#submit'][0];
+    return $form['#options']['submit_handler'];
   }
 }
 
Index: pageroute.page_add.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pageroute/pageroute.page_add.inc,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 pageroute.page_add.inc
--- pageroute.page_add.inc	30 Sep 2009 14:34:10 -0000	1.1.2.11
+++ pageroute.page_add.inc	17 Oct 2009 11:38:29 -0000
@@ -32,6 +32,7 @@
 
       $form += drupal_retrieve_form($type .'_node_form', $form_state, $node);
       drupal_prepare_form($type .'_node_form', $form, $form_state);
+      $form['#options']['submit_handler'] = $form['buttons']['submit']['#submit'][0];
     }
     else {
       drupal_access_denied();
@@ -88,6 +89,6 @@
   }
 
   public static function getDefaultSubmitHandler($form) {
-    return $form['buttons']['submit']['#submit'][0];
+    return $form['#options']['submit_handler'];
   }
 }

But I won't close the issue until I have a simpletest for it.

sepgil’s picture

Status: Needs work » Fixed

sorry, forgot to close the issue on saturday. I implementet the test on that day...

davej’s picture

@sgilits: thanks, tested and working here.

Dave

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.