Skip to content
Snippets Groups Projects
Commit c26700ad authored by Daniel Wehner's avatar Daniel Wehner Committed by Tim Plunkett
Browse files

Issue #1578028 by dawehner: Change the way the exposed form in block AJAX message is done.

parent f7ba3721
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -125,7 +125,6 @@ function get_cache_type() {
* Provide the default form for setting options.
*/
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
// It is very important to call the parent function here:
parent::options_form($form, $form_state);
......@@ -148,6 +147,14 @@ function options_form(&$form, &$form_state) {
'#default_value' => $this->get_cache_type(),
);
break;
case 'exposed_form_options':
$this->view->init_handlers();
if (!$this->uses_exposed() && parent::uses_exposed()) {
$form['exposed_form_options']['warning'] = array(
'#weight' => -10,
'#markup' => '<div class="messages warning">' . t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.') . '</div>',
);
}
}
}
......@@ -179,10 +186,6 @@ function uses_exposed() {
if ($this->use_ajax()) {
return parent::uses_exposed();
}
//Warn user that for blocks, exposed filters only work with AJAX.
if (parent::uses_exposed()) {
drupal_set_message(t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.'),'error',FALSE);
}
return FALSE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment