diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 5735f29..dc40e7a 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -76,6 +76,12 @@ function seven_custom_block_add_list($variables) { $content = '' . check_plain($type->label()) . ''; $content .= '
' . filter_xss_admin($type->description) . '
'; $options['html'] = TRUE; + if (($destination = drupal_get_destination()) && $destination['destination'] !== current_path()) { + // A destination parameter is set other than the current path so we + // respect that by adding it to the generated links. If the current path + // is returned, we ignore it as we don't want to end up back at block/add. + $options['query'] = $destination; + } $output .= l($content, 'block/add/' . $type->id(), $options); $output .= ''; }