This doesn't allow me to add custom submit callbacks - unless I completely alter the $form['#submit'] array to set mine first, but that's more lines. Either way, drupal_goto() is bad practice there anyway, $form_state['redirect'] should be used. Patch coming up.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | don_t_use_drupal_goto-1916036-6.patch | 1.37 KB | jeroent |
| #1 | 1916036-1.patch | 635 bytes | swentel |
Comments
Comment #1
swentel commentedBetter title + patch - I haven't checked for other occurences of drupal_goto(), but this once fixes it for me in case a site is deleted where I pick in with custom functionality.
Comment #2
malc0mn commentedThanks for that one! Will apply later today.
(Until recently, had the same prob in one of my other modules, I didn't know this existed in D7. This should really be added to the D7 FAPI docs, I learned it from the comments.)
Comment #3
malc0mn commentedapplied, fixed some others as well.
Comment #4
malc0mn commentedShould remove these from the D6 version as well...
Comment #5
malc0mn commentedD6 prod_mon still has them in:
prod_monitor_overview_form_submit()
prod_monitor_flush_form_submit()
prod_monitor_delete_form_submit()
Comment #6
jeroentCreated patch for D6 version of this module. Patch attached.
Comment #7
malc0mn commentedYou missed the removal of one drupal_goto:
Applied your patch and removed the drupal_goto mentioned above as well, thanks!!!
mlc.
Comment #8
malc0mn commentedprod_monitor_overview_form_submit()redirect was no longer working.$form_state['storage']needs to be empty in D6 for the$form_state['redirect']to work. Learn something new about D6 still :-s.Fixed.