Get forms are always validated

Created on 7 April 2023, over 1 year ago
Updated 2 June 2023, over 1 year ago

Problem/Motivation

GET forms like views exposed form are automatically processed and so input are marked as validated, so there is the valid input class added.

core/lib/Drupal/Core/Form/FormBuilder.php::processForm():

// With GET, these forms are always submitted if requested.
    if ($form_state->isMethodType('get') && $form_state->getAlwaysProcess()) {

So the later processing marks the form element as validated.

Remaining tasks

Need to find a way to detect if the user has just arrived on a page or if we should find a way to exclude GET form or stay as it is.

🐛 Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

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

Comments & Activities

Production build 0.71.5 2024