Commit 1fdb3eea authored by catch's avatar catch

Issue #1884176 by dawehner, damiankloip: Fixed Exposed form ajax does not work.

parent a0529f50
......@@ -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,
......
......@@ -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 exposed 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.
*/
......
......@@ -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);
......
......@@ -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'),
......
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