Rename #type => "actions" / EntityFormController::actions to "buttons" or similar

Created on 28 February 2013, almost 12 years ago
Updated 17 January 2025, 5 days ago

While reviewing #1920686-1: Deleting a menu gives fatal error + the delete button is shown on system menu's. β†’ I was confused by protected function actions() was for. The PHPDoc on http://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21E... says:

"Returns an array of supported actions for the current entity form."

;) Not very helpful...

"action" to me, is an HTML attribute on the <form> tag, that describes where the form should post its results to. I was confused why you ever needed more than one "action" on a form.

The body of that function looks like a bunch of definitions of submit buttons (without #type => submit for some reason). I'm mystified therefore why we don't call this "buttons()" or something similarly self-descripting.

Tim said it's because FAPI has a type "actions" so he's just copy/pasting more or less: http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc...

The description there says "A wrapper element to group one or more buttons in a form. Use of the 'actions' element as an array key helps to ensure proper styling in themes and to enable other modules to properly alter a form's actions."

So if it's a group of one or more buttons, let's just call it buttons, hm? :)

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

forms system

Created by

πŸ‡¨πŸ‡¦Canada webchick Vancouver πŸ‡¨πŸ‡¦

Live updates comments and jobs are added and updated live.
  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024