Triggered element not detected when double click prevention enabled

Created on 25 January 2024, 5 months ago

Problem/Motivation

Enabling javascript_use_double_submit_protection stops the clicked submit button as being set as $form_state['triggering_element'], I have a custom form that's displayed inside of a ctools modal.

https://www.drupal.org/node/1705618 β†’

Steps to reproduce

Set $conf['javascript_use_double_submit_protection'] as TRUE, go to a form with more than one submit button, in a modal. Clicking the final submit button and the Form API sets the first button on the form as the $form_state['triggering_element'] as $form_state['triggering_element'] is not set.

The form in my test is displayed inside of a Modal, but I can't see how this makes any difference.

With the lib/ $conf['javascript_use_double_submit_protection'] set to FALSE the form submits as expected.

Proposed resolution

To do

Merge request link

To do

Remaining tasks

Need to test and see if replicable in a fresh install of Drupal

User interface changes

To do

API changes

To do

Data model changes

To do

Release notes snippet

To do

πŸ› Bug report
Status

Closed: works as designed

Version

7.0 ⚰️

Component
FormΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¬πŸ‡§United Kingdom darrenwh Bristol

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

Comments & Activities

Production build 0.69.0 2024