Problem/Motivation

FormBuilder::doBuildForm() contains specific support for an Internet Explorer quirk:

      // If a form contains a single textfield, and the ENTER key is pressed
      // within it, Internet Explorer submits the form with no POST data
      // identifying any submit button. Other browsers submit POST data as
      // though the user clicked the first button. Therefore, to be as
      // consistent as we can be across browsers, if no 'triggering_element' has
      // been identified yet, default it to the first button.
      $buttons = $form_state->getButtons();
      if (!$form_state->isProgrammed() && !$form_state->getTriggeringElement() && !empty($buttons)) {
        $form_state->setTriggeringElement($buttons[0]);
      }

It seems likely that this is obsolete now.

Steps to reproduce

Proposed resolution

GET forms (such as Views exposed filters) don't have to include a submit button input, so I think we should always default to the first button if we didn't find one - this makes sense to me and prevents breaking existing behaviour.

Therefore, the only thing to do here is update the comment so it's more accurate.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3568491

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

aayushpathak’s picture

working on it !

aayushpathak’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Appears to be breaking the tests so maybe it is used?

longwave-bot made their first commit to this issue’s fork.

longwave’s picture

Full disclosure: trying something new here, using an AI agent to work on issues and tests in a private clone of core. There is always a human in the loop, I manually review and approve all output before pushing back here. Commits and pushes by @longwave-bot are from the agent.

The test changes here were written by DeepSeek v4 Flash.

longwave’s picture

Title: Remove IE support from FormBuilder » Remove IE comment from FormBuilder
Status: Needs work » Needs review

As the tests discovered this wasn't just for supporting an obsolete IE feature. GET forms (such as Views exposed filters) don't have to include a submit button input, so I think we should always default to the first button if we didn't find one - this makes sense to me and prevents breaking existing behaviour.

Therefore, the only thing to do here is update the comment so it's more accurate.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

looks like a good removal to me

  • godotislate committed 5e2df7d5 on 11.x
    task: #3568491 Remove IE comment from FormBuilder
    
    By: longwave
    By:...

  • godotislate committed cf543471 on main
    task: #3568491 Remove IE comment from FormBuilder
    
    By: longwave
    By:...
godotislate’s picture

Version: main » 11.x-dev
Component: forms system » documentation
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed and pushed cf54347 to main and 5e2df7d to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

godotislate’s picture

Title: Remove IE comment from FormBuilder » Revise comment about form submission without submit button data from FormBuilder

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.