From 8bc1fea750627b59ef0a7ff037ebc7c0bae8b42a Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 10 Dec 2009 17:26:04 +0000 Subject: #655614 by David_Rothstein and ksenzee: Remove code that causes changes made by submitting a form in the overlay to not be reflected when the window automatically closes. --- modules/overlay/overlay-child.js | 8 -------- modules/overlay/overlay.module | 19 ------------------- 2 files changed, 27 deletions(-) (limited to 'modules') diff --git a/modules/overlay/overlay-child.js b/modules/overlay/overlay-child.js index 1b8e54a72..5a81de20f 100644 --- a/modules/overlay/overlay-child.js +++ b/modules/overlay/overlay-child.js @@ -54,14 +54,6 @@ Drupal.behaviors.overlayChild = { // Ok, now we can tell the parent window we're ready. parent.Drupal.overlay.bindChild(window); - // If a form is being displayed, it has a hidden field for the parent - // window's location. Pass it that information. Letting the server side - // know the parent window's location lets us avoid unnecessary redirects - // when the overlay window is being closed automatically. - var re = new RegExp('^' + parent.Drupal.settings.basePath); - var path = parent.window.location.pathname.replace(re, ''); - $('#edit-overlay-parent-url').val(path); - // Install onBeforeUnload callback, if module is present. if ($.isObject(Drupal.onBeforeUnload) && !Drupal.onBeforeUnload.callbackExists('overlayChild')) { Drupal.onBeforeUnload.addCallback('overlayChild', function () { diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module index 101599009..ca2d273db 100644 --- a/modules/overlay/overlay.module +++ b/modules/overlay/overlay.module @@ -145,20 +145,6 @@ function overlay_library() { return $libraries; } -/** - * Implements hook_form_alter(). - * - * For forms displayed in the overlay, add a hidden form field that lets us pass - * the parent window's URL into the form. - */ -function overlay_form_alter(&$form, &$form_state, $form_id) { - if (overlay_get_mode() == 'child') { - $form['overlay_parent_url'] = array( - '#type' => 'hidden', - ); - } -} - /** * Implements hook_drupal_goto_alter(). * @@ -382,11 +368,6 @@ function overlay_form_submit($form, &$form_state) { if (!empty($form_state['redirect'])) { $settings['overlayChild']['redirect'] = url($url, $settings); } - // If the redirect destination is the same as the parent window, just - // close the overlay without redirecting the parent. - if (url($form['overlay_parent_url']['#value']) == $settings['overlayChild']['redirect']) { - unset($settings['overlayChild']['redirect']); - } drupal_add_js($settings, array('type' => 'setting')); } // Tell FAPI to redraw the form without redirection after all submit -- cgit v1.2.3