No error messages are shown for applied validation on a view exposed filter with on "AJAX"

Created on 6 June 2018, over 6 years ago
Updated 1 March 2024, 9 months ago

Problem/Motivation

When form validation errors occur in Views exposed forms when the View has AJAX enabled, the error messages are not displayed.

Steps to reproduce

Create a view with an exposed filter on the author
Enable ajax on the view
Use the view and submit the form with a non-existent username
No error message is shown.

Proposed resolution

Prepend status messages in the views ajax controller.

Original report

The applied validation error messages are not shown for a view exposed filter on failure when "Ajax" is on.

the messages are displayed again on next page load.

There is an older issue opened for Drupal 7

https://www.drupal.org/node/1833322

Recommended solution:


function MODULE_views_ajax_data_alter(&$commands, $view) {
$commands[] = ajax_command_prepend($commands[0]['selector'], theme('status_messages'));
}

Is the correct way to solve the problem or solution should be implemented in views module itself ?

🐛 Bug report
Status

Fixed

Version

9.5

Component
Views 

Last updated about 5 hours ago

Created by

🇩🇪Germany nghai

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024