Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Actually, it is quite a bit worse than overriding the destination redirect. It actually ignores the destination *and* doesn't delete the item (never makes it to the confirmation page).
To fix both issues (not redirecting, and not deleting), change the functions subs_form_submit_delete() in subs.pages.inc to the following:
function subs_form_submit_delete($form, &$form_state) {
global $base_url;
$subscription = $form_state['subscription'];
$subscription_uri = entity_uri('subs', $subscription);
$redirect_path = $subscription_uri['path'] . '/delete';
$dest = drupal_get_destination();
unset($_GET['destination']);
if (isset($dest['destination'])) {
// for the reason we use $base_url here, see: http://stackoverflow.com/questions/4143115/can-i-set-a-form-state-redirect-with-a-destination-parameter-in-form-submission
$form_state['redirect'] = $base_url . '/' . $redirect_path . '?'. $dest['destination'];
}
else {
$form_state['redirect'] = $redirect_path;
}
}
I haven't submitted a proper patch because many kittens die when you do the above. But it should give the maintainers a good idea of where the problem is.
Comments
Comment #1
drawk CreditAttribution: drawk commentedActually, it is quite a bit worse than overriding the destination redirect. It actually ignores the destination *and* doesn't delete the item (never makes it to the confirmation page).
Comment #2
drawk CreditAttribution: drawk commentedTo fix both issues (not redirecting, and not deleting), change the functions subs_form_submit_delete() in subs.pages.inc to the following:
I haven't submitted a proper patch because many kittens die when you do the above. But it should give the maintainers a good idea of where the problem is.
Comment #3
alexweber CreditAttribution: alexweber commentedThanks drawk, I'll mop up the kittens. :)