Created
October 11, 2017 18:43
-
-
Save vensires/b083e395a3e4b6e6de9baef8064b6aec to your computer and use it in GitHub Desktop.
Place the following code in a custom Drupal (7.x) module to fix the issue described in https://www.drupal.org/node/2915545. Replace MODULE with your custom module's name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_mailchimp_signup_subscribe_form_alter(). | |
*/ | |
function MODULE_form_mailchimp_signup_subscribe_form_alter(&$form, &$form_state) { | |
$form['#submit'][] = 'MODULE_mailchimp_signup_subscribe_form_redirect'; | |
} | |
/** | |
* Submit callback for mailchimp signup subscribe form. | |
*/ | |
function MODULE_mailchimp_signup_subscribe_form_redirect($form, &$form_state) { | |
if (!isset($form_state['redirect'])) { | |
$form_state['redirect'] = drupal_is_front_page() ? '' : current_path(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment