diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-07-28 01:21:58 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-07-28 01:21:58 +0000 |
commit | 788c2e8961098dc15644fc878876f3f7c5ce99b4 (patch) | |
tree | 86d703488b345f9e68e618d42dbf5167cbd11c61 /modules/overlay | |
parent | facb336ec277ad7bca5ffc70b5efa51ffe2e6945 (diff) | |
download | brdo-788c2e8961098dc15644fc878876f3f7c5ce99b4.tar.gz brdo-788c2e8961098dc15644fc878876f3f7c5ce99b4.tar.bz2 |
- Patch #841410 by David_Rothstein: field UI JavaScript is broken after validation fails due to an error in toolbar.js.
Diffstat (limited to 'modules/overlay')
-rw-r--r-- | modules/overlay/overlay.module | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module index ea0cddf4a..13e32f1b6 100644 --- a/modules/overlay/overlay.module +++ b/modules/overlay/overlay.module @@ -707,7 +707,9 @@ function overlay_set_regions_to_render($regions = NULL) { * supplemental overlay regions (e.g., a region containing a toolbar). Passing * in a region that is intended to display the main page content is not * supported; the region will be rendered by this function, but the main page - * content will not appear in it. + * content will not appear in it. In addition, although this function returns + * the rendered HTML for the provided region, it does not place it on the final + * page, nor add any of its associated JavaScript or CSS to the page. * * @param $region * The name of the page region that should be rendered. @@ -731,7 +733,17 @@ function overlay_render_region($region) { '#theme' => NULL, '#theme_wrappers' => array(), ); + // Render the region, but do not cache any JavaScript or CSS associated with + // it. This region might not be included the next time drupal_render_page() + // is called, and we do not want its JavaScript or CSS to erroneously appear + // on the final rendered page. + $original_js = drupal_add_js(); + $original_css = drupal_add_css(); + $js = &drupal_static('drupal_add_js'); + $css = &drupal_static('drupal_add_css'); $markup = drupal_render_page($page); + $js = $original_js; + $css = $original_css; // Indicate that the main page content has not, in fact, been displayed, so // that future calls to drupal_render_page() will be able to render it // correctly. |