Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
4c6309c6
Commit
4c6309c6
authored
Dec 10, 2013
by
webchick
Browse files
Issue
#2096577
by Wim Leers, vijaycs85: Remove drupal_add_css() from views.module.
parent
5e3bf099
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/views/includes/ajax.inc
View file @
4c6309c6
...
...
@@ -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'
])))
{
...
...
core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTest.php
View file @
4c6309c6
...
...
@@ -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.'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment