$form_state['clicked_button'] has been deprecated in D7 in favor of $form_state['triggering_element'].

Time to remove it.

CommentFileSizeAuthor
drupal8.form-clicked-button-remove.0.patch1.88 KBsun
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Grepping for 'clicked_button' yields a couple more results, but none are actually using $form_state['clicked_button']. An example from file.module:
$clicked_button = end($form_state['triggering_element']['#parents']);
Whether we want to "clean that up" or not (I'm not entirely sure that it's actually incorrect) I think can be a follow-up.
Guess, this needs a change notification, even if it was deprecated in D7.

sun’s picture

yeah, there are remaining instances of the string "clicked_button" in file.module and also Form API tests, but those are fine, as long as no code is using $form_state['clicked_button'].

catch’s picture

Status: Reviewed & tested by the community » Fixed

Yep. Committed/pushed to 8.x.

Wonder how many @deprecated are left at the moment.

sun’s picture

tstoeckler’s picture

Added a change notice.

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