Commit 4c6309c6 authored by webchick's avatar webchick

Issue #2096577 by Wim Leers, vijaycs85: Remove drupal_add_css() from views.module.

parent 5e3bf099
......@@ -35,7 +35,7 @@ function views_ajax_form_wrapper($form_id, &$form_state) {
// These forms have the title built in, so set the title here:
if (empty($form_state['ajax']) && !empty($form_state['title'])) {
drupal_add_css(drupal_get_path('module', 'views_ui') . '/css/views_ui.admin.css');
$form['#attached']['css'][] = drupal_get_path('module', 'views_ui') . '/css/views_ui.admin.css';
}
if (!empty($form_state['ajax']) && (empty($form_state['executed']) || !empty($form_state['rerender']))) {
......
......@@ -161,11 +161,17 @@ function testHeaderStorage() {
// Now add some css/jss before running the view.
// Make sure that this css is not added when running the cached view.
$view->storage->set('id', 'test_cache_header_storage_2');
$system_css_path = drupal_get_path('module', 'system') . '/css/system.maintenance.css';
drupal_add_css($system_css_path);
$system_js_path = drupal_get_path('module', 'user') . '/user.permissions.js';
drupal_add_js($system_js_path);
$attached = array(
'#attached' => array(
'css' => array(
drupal_get_path('module', 'system') . '/css/system.maintenance.css' => array(),
),
'js' => array(
drupal_get_path('module', 'user') . '/user.permissions.js' => array(),
),
),
);
drupal_render($attached);
$view->destroy();
$output = $view->preview();
......@@ -180,8 +186,8 @@ function testHeaderStorage() {
$css = drupal_add_css();
$js = drupal_add_js();
$this->assertFalse(isset($css[basename($system_css_path)]), 'Make sure that unrelated css is not added.');
$this->assertFalse(isset($js[$system_js_path]), 'Make sure that unrelated js is not added.');
$this->assertFalse(isset($css['system.maintenance.css']), 'Make sure that unrelated css is not added.');
$this->assertFalse(isset($js[drupal_get_path('module', 'user') . '/user.permissions.js']), 'Make sure that unrelated js is not added.');
}
}
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