Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
1fdb3eea
Commit
1fdb3eea
authored
Jan 17, 2013
by
Nathaniel Catchpole
Browse files
Issue
#1884176
by dawehner, damiankloip: Fixed Exposed form ajax does not work.
parent
a0529f50
Changes
5
Hide whitespace changes
Inline
Side-by-side
core/modules/views/lib/Drupal/views/Plugin/views/exposed_form/ExposedFormPluginBase.php
View file @
1fdb3eea
...
...
@@ -124,7 +124,7 @@ function render_exposed_form($block = FALSE) {
// Deal with any exposed filters we may have, before building.
$form_state
=
array
(
'view'
=>
&
$this
->
view
,
'display'
=>
&
$this
->
display
,
'display'
=>
&
$this
->
view
->
display_handler
->
display
,
'method'
=>
'get'
,
'rerender'
=>
TRUE
,
'no_redirect'
=>
TRUE
,
...
...
core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php
View file @
1fdb3eea
...
...
@@ -49,7 +49,7 @@ protected function setUp() {
}
/**
* Tests whether the reset button works on an expoed form.
* Tests whether the reset button works on an expo
s
ed form.
*/
public
function
testResetButton
()
{
$this
->
drupalGet
(
'test_reset_button'
,
array
(
'query'
=>
array
(
'type'
=>
'article'
)));
...
...
@@ -88,6 +88,22 @@ public function testRenameResetButton() {
$this
->
helperButtonHasLabel
(
'edit-reset'
,
$expected_label
);
}
/**
* Tests the exposed form markup.
*/
public
function
testExposedFormRender
()
{
$view
=
views_get_view
(
'test_reset_button'
);
$this
->
executeView
(
$view
);
$exposed_form
=
$view
->
display_handler
->
getPlugin
(
'exposed_form'
);
$this
->
drupalSetContent
(
$exposed_form
->
render_exposed_form
());
$expected_id
=
drupal_clean_css_identifier
(
'views-exposed-form-'
.
$view
->
storage
->
id
()
.
'-'
.
$view
->
current_display
);
$this
->
assertFieldByXpath
(
'//form/@id'
,
$expected_id
,
'Expected form ID found.'
);
$expected_action
=
url
(
$view
->
display_handler
->
getUrl
());
$this
->
assertFieldByXPath
(
'//form/@action'
,
$expected_action
,
'The expected value for the action attribute was found.'
);
}
/**
* Tests the admin interface of exposed filter and sort items.
*/
...
...
core/modules/views/views.module
View file @
1fdb3eea
...
...
@@ -914,7 +914,6 @@ function views_library_info() {
'version'
=>
VERSION
,
'js'
=>
array
(
"
$path
/base.js"
=>
array
(
'group'
=>
JS_DEFAULT
),
"
$path
/ajax.js"
=>
array
(
'group'
=>
JS_DEFAULT
),
"
$path
/ajax_view.js"
=>
array
(
'group'
=>
JS_DEFAULT
),
),
'dependencies'
=>
array
(
...
...
@@ -1570,11 +1569,6 @@ function views_exposed_form($form, &$form_state) {
$form
[
'#id'
]
=
drupal_clean_css_identifier
(
'views_exposed_form-'
.
check_plain
(
$view
->
storage
->
get
(
'name'
))
.
'-'
.
check_plain
(
$display
[
'id'
]));
// $form['#attributes']['class'] = array('views-exposed-form');
// If using AJAX, we need the form plugin.
if
(
$view
->
use_ajax
)
{
$form
[
'#attached'
][
'library'
][]
=
array
(
'system'
,
'jquery.form'
);
}
$exposed_form_plugin
=
$form_state
[
'exposed_form_plugin'
];
$exposed_form_plugin
->
exposed_form_alter
(
$form
,
$form_state
);
...
...
core/modules/views/js/ajax.js
→
core/modules/views/
views_ui/
js/ajax.js
View file @
1fdb3eea
File moved
core/modules/views/views_ui/views_ui.module
View file @
1fdb3eea
...
...
@@ -277,11 +277,14 @@ function views_ui_theme() {
function
views_ui_library_info
()
{
$libraries
=
array
();
$path
=
drupal_get_path
(
'module'
,
'views_ui'
)
.
'/js/'
;
$libraries
[
'views_ui.admin'
]
=
array
(
'title'
=>
'Views UI ADMIN'
,
'version'
=>
VERSION
,
'js'
=>
array
(
drupal_get_path
(
'module'
,
'views_ui'
)
.
'/js/views-admin.js'
=>
array
(
'group'
=>
JS_DEFAULT
),
$path
.
'ajax.js'
=>
array
(
'group'
=>
JS_DEFAULT
),
$path
.
'views-admin.js'
=>
array
(
'group'
=>
JS_DEFAULT
),
),
'dependencies'
=>
array
(
array
(
'system'
,
'jquery'
),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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