diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-15 16:18:46 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-15 16:18:46 +0000 |
commit | e1642603eac05665d959c3d63ea8d1efbe9e431a (patch) | |
tree | b927cc0b278e90594310d8291091d76af9c57d40 /modules | |
parent | c7557262b3ac01f40613dd6141ef09d1ae7b84ba (diff) | |
download | brdo-e1642603eac05665d959c3d63ea8d1efbe9e431a.tar.gz brdo-e1642603eac05665d959c3d63ea8d1efbe9e431a.tar.bz2 |
#216098 by kwinters, jgoldberg, drawk, sun: Make drupal_goto() use the same parameters as url().
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment/comment.module | 2 | ||||
-rw-r--r-- | modules/image/image.admin.inc | 2 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 2 | ||||
-rw-r--r-- | modules/openid/openid.module | 2 | ||||
-rw-r--r-- | modules/simpletest/tests/common_test.module | 6 | ||||
-rw-r--r-- | modules/simpletest/tests/session_test.module | 4 | ||||
-rw-r--r-- | modules/system/system.api.php | 24 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.admin.inc | 2 | ||||
-rw-r--r-- | modules/user/user.pages.inc | 2 |
9 files changed, 21 insertions, 25 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 073e4c74a..87ef24c0a 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2092,7 +2092,7 @@ function comment_form_submit($form, &$form_state) { $query['page'] = $page; } // Redirect to the newly posted comment. - $redirect = array('node/' . $node->nid, $query, 'comment-' . $comment->cid); + $redirect = array('node/' . $node->nid, array('query' => $query, 'fragment' => 'comment-' . $comment->cid)); } else { watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject), WATCHDOG_WARNING); diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index 5028279bb..e18422101 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -137,7 +137,7 @@ function image_style_form_add_submit($form, &$form_state) { // Load the configuration form for this option. if (isset($effect['form callback'])) { $path = 'admin/config/media/image-styles/edit/' . $form_state['image_style']['name'] . '/add/' . $form_state['values']['new']; - $form_state['redirect'] = array($path, array('weight' => $form_state['values']['weight'])); + $form_state['redirect'] = array($path, array('query' => array('weight' => $form_state['values']['weight']))); } // If there's no form, immediately add the image effect. else { diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index adb5f2da3..b9cedaeb1 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -302,7 +302,7 @@ function node_form_delete_submit($form, &$form_state) { unset($_GET['destination']); } $node = $form['#node']; - $form_state['redirect'] = array('node/' . $node->nid . '/delete', $destination); + $form_state['redirect'] = array('node/' . $node->nid . '/delete', array('query' => $destination)); } diff --git a/modules/openid/openid.module b/modules/openid/openid.module index d910e4dfa..f42c3db2a 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -448,7 +448,7 @@ function openid_authentication($response) { // We'll want to redirect back to the same place. $destination = drupal_get_destination(); unset($_GET['destination']); - drupal_goto('user/register', $destination); + drupal_goto('user/register', array('query' => $destination)); } else { unset($form_state['values']['response']); diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index 74866f098..8b6779463 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -63,9 +63,9 @@ function common_test_drupal_goto_land_fail() { /** * Implement hook_drupal_goto_alter(). */ -function common_test_drupal_goto_alter(&$args) { - if ($args['path'] == 'common-test/drupal_goto/fail') { - $args['path'] = 'common-test/drupal_goto/redirect'; +function common_test_drupal_goto_alter(&$path, &$options, &$http_response_code) { + if ($path == 'common-test/drupal_goto/fail') { + $path = 'common-test/drupal_goto/redirect'; } } diff --git a/modules/simpletest/tests/session_test.module b/modules/simpletest/tests/session_test.module index d6c9914b2..01a9d3225 100644 --- a/modules/simpletest/tests/session_test.module +++ b/modules/simpletest/tests/session_test.module @@ -156,7 +156,7 @@ function session_test_form_user_login_alter(&$form) { * Force the redirection to go to a non-secure page after being on a secure * page through https.php. */ -function session_test_drupal_goto_alter(&$args) { +function session_test_drupal_goto_alter(&$path, &$options, &$http_response_code) { global $base_insecure_url; - $args['path'] = $base_insecure_url . '/' . $args['path']; + $path = $base_insecure_url . '/' . $path; } diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 8826e6a08..c1f597855 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2262,21 +2262,17 @@ function hook_install_tasks() { /** * Change the page the user is sent to by drupal_goto(). * - * @param $args - * The array keys are the same as drupal_goto() arguments and the array can - * be changed. - * <code> - * $args = array( - * 'path' => &$path, - * 'query' => &$query, - * 'fragment' => &$fragment, - * 'http_response_code' => &$http_response_code, - * ); - * </code> - */ -function hook_drupal_goto_alter(array $args) { + * @param &$path + * A Drupal path or a full URL. + * @param &$options + * An associative array of additional URL options to pass to url(). + * @param &$http_response_code + * The HTTP status code to use for the redirection. See drupal_goto() for more + * information. + */ +function hook_drupal_goto_alter(&$path, &$options, &$http_response_code) { // A good addition to misery module. - $args['http_response_code'] = 500; + $http_response_code = 500; } /** diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index c44fdeec1..7a12fbdc4 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -391,7 +391,7 @@ function taxonomy_overview_terms($form, &$form_state, $vocabulary) { '#type' => 'submit', '#value' => t('Reset to alphabetical') ); - $form_state['redirect'] = array($_GET['q'], (isset($_GET['page']) ? array('page' => $_GET['page']) : '')); + $form_state['redirect'] = array($_GET['q'], (isset($_GET['page']) ? array('query' => array('page' => $_GET['page'])) : array())); } return $form; diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index eef7d3f62..0f42729a2 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -294,7 +294,7 @@ function user_edit_cancel_submit($form, &$form_state) { unset($_GET['destination']); } // Note: We redirect from user/uid/edit to user/uid/cancel to make the tabs disappear. - $form_state['redirect'] = array("user/" . $form['#user']->uid . "/cancel", $destination); + $form_state['redirect'] = array("user/" . $form['#user']->uid . "/cancel", array('query' => $destination)); } /** |