Commit 788c2e89 authored by Dries's avatar Dries

- Patch #841410 by David_Rothstein: field UI JavaScript is broken after...

- Patch #841410 by David_Rothstein: field UI JavaScript is broken after validation fails due to an error in toolbar.js.
parent facb336e
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment