diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-07-28 15:06:12 -0400 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-07-28 15:06:12 -0400 |
commit | 43b125e883d188ae5181d0700cbae45670adef64 (patch) | |
tree | 18820b93d0640c7588a7e0c1735f6b99be58f850 /modules/overlay | |
parent | b3e2b2ad52d6ef28996626bfba92fbac7d29a2dc (diff) | |
download | brdo-43b125e883d188ae5181d0700cbae45670adef64.tar.gz brdo-43b125e883d188ae5181d0700cbae45670adef64.tar.bz2 |
Issue #936686 by David_Rothstein, Einewton: Fixed 'Installation failed' errors when installing modules from Update Manager w/ Overlay.
Diffstat (limited to 'modules/overlay')
-rw-r--r-- | modules/overlay/overlay.module | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module index 44c230b64..9af18e18e 100644 --- a/modules/overlay/overlay.module +++ b/modules/overlay/overlay.module @@ -137,8 +137,15 @@ function overlay_init() { } if (isset($_GET['render']) && $_GET['render'] == 'overlay') { - // If this page shouldn't be rendered here, redirect to the parent. - if (!path_is_admin($current_path)) { + // If a previous page requested that we close the overlay, close it and + // redirect to the final destination. + if (isset($_SESSION['overlay_close_dialog'])) { + call_user_func_array('overlay_close_dialog', $_SESSION['overlay_close_dialog']); + unset($_SESSION['overlay_close_dialog']); + } + // If this page shouldn't be rendered inside the overlay, redirect to the + // parent. + elseif (!path_is_admin($current_path)) { overlay_close_dialog($current_path); } @@ -226,14 +233,23 @@ function overlay_library() { /** * Implements hook_drupal_goto_alter(). - * - * If the current page request is inside the overlay, add ?render=overlay to - * the new path, so that it appears correctly inside the overlay. - * - * @see overlay_get_mode() */ function overlay_drupal_goto_alter(&$path, &$options, &$http_response_code) { if (overlay_get_mode() == 'child') { + // The authorize.php script bootstraps Drupal to a very low level, where + // the PHP code that is necessary to close the overlay properly will not be + // loaded. Therefore, if we are redirecting to authorize.php inside the + // overlay, instead redirect back to the current page with instructions to + // close the overlay there before redirecting to the final destination; see + // overlay_init(). + if ($path == system_authorized_get_url() || $path == system_authorized_batch_processing_url()) { + $_SESSION['overlay_close_dialog'] = array($path, $options); + $path = current_path(); + $options = drupal_get_query_parameters(); + } + + // If the current page request is inside the overlay, add ?render=overlay + // to the new path, so that it appears correctly inside the overlay. if (isset($options['query'])) { $options['query'] += array('render' => 'overlay'); } |