From a8cb00de115e0b2668dabb78d79d61802eb1cc42 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 16 Apr 2010 13:39:42 +0000 Subject: [PATCH] - Patch #655740 by ksenzee, casey, aspilicious: fixed small JavaScript issues in the overlay module. --- includes/module.inc | 2 ++ modules/overlay/overlay-child.js | 4 ++-- modules/overlay/overlay-parent.js | 14 ++++++-------- modules/system/system.test | 10 ++++++++++ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/includes/module.inc b/includes/module.inc index 10996eb655a2..ec0f83a6b1e0 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -369,6 +369,8 @@ function module_enable($module_list, $enable_dependencies = TRUE) { registry_update(); // Refresh the schema to include it. drupal_get_schema(NULL, TRUE); + // Clear entity cache. + entity_info_cache_clear(); // Now install the module if necessary. if (drupal_get_installed_schema_version($module, TRUE) == SCHEMA_UNINSTALLED) { diff --git a/modules/overlay/overlay-child.js b/modules/overlay/overlay-child.js index 018445517347..7570ec6130b0 100644 --- a/modules/overlay/overlay-child.js +++ b/modules/overlay/overlay-child.js @@ -31,8 +31,8 @@ Drupal.behaviors.overlayChild = { // may have decided to tell us the parent window to close the popup dialog. if (settings.closeOverlay) { parent.Drupal.overlay.bindChild(window, true); - // Close the child window from a separate thread because the current - // one is busy processing Drupal behaviors. + // Use setTimeout to close the child window from a separate thread, + // because the current one is busy processing Drupal behaviors. setTimeout(function () { // We need to store the parent variable locally because it will // disappear as soon as we close the iframe. diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index 2ed3914cf5a7..d362a945d71b 100644 --- a/modules/overlay/overlay-parent.js +++ b/modules/overlay/overlay-parent.js @@ -517,7 +517,7 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) { if (!$target.size()) { $target = self.$iframeDocument; } - setTimeout(function () { $target.focus(); }, 10); + $target.focus(); return false; } }); @@ -528,16 +528,16 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) { if (event.keyCode) { if (event.keyCode == $.ui.keyCode.TAB) { if (event.shiftKey && event.target == $firstTabbable.get(0)) { - setTimeout(function () { $closeButton.focus(); }, 10); + $closeButton.focus(); return false; } else if (!event.shiftKey && event.target == $lastTabbable.get(0)) { - setTimeout(function () { $closeButton.focus(); }, 10); + $closeButton.focus(); return false; } } else if (event.keyCode == $.ui.keyCode.ESCAPE) { - setTimeout(function () { self.close(); }, 10); + self.close(); return false; } } @@ -548,11 +548,9 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) { // close button of the dialog (default). $(document).bind('keydown.overlay-event', function (event) { if (event.keyCode && event.keyCode == $.ui.keyCode.TAB) { - setTimeout(function () { - if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) { + if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) { $closeButton.focus(); - } - }, 10); + } return false; } }); diff --git a/modules/system/system.test b/modules/system/system.test index 6fb15a7362d4..e20fd769e154 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -157,6 +157,16 @@ class EnableDisableTestCase extends ModuleTestCase { $this->drupalPost('admin/modules', $edit, t('Save configuration')); $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); } + + /** + * Tests entity cache after enabling a module with a dependency on an enitity + * providing module. + */ + function testEntityCache() { + module_enable(array('entity_cache_test')); + $info = variable_get('entity_cache_test'); + $this->assertNotNull($info, t('Entity information must not be NULL')); + } } /**