Forms API reference (http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/...) says:

#submit
Used by: button, submit
Description: Indicates whether or not button should submit the form.
Values: TRUE or FALSE

However, in forms.inc we have, in theme_button (http://drupaldocs.org/api/head/function/theme_button), the 'submit' type is hardcoded. A simple patch is attached to use the #submit attribute (if set, otherwise continue using the 'submit' type).

CommentFileSizeAuthor
form.inc_19.patch812 bytesostolop

Comments

chx’s picture

Status: Active » Closed (won't fix)

#submit as been renamed to executes_submit_callback. Nothing to change here.

ostolop’s picture

Oh... sorry about sounding ignorant, but is this documented anywhere? How could one have found out about this?

pwolanin’s picture

Project: Drupal core » Documentation
Component: forms system » Developer Guide
Status: Closed (won't fix) » Active

I second the question (and reassigned this as a documentation bug). Is the Forms API reference invalid for 4.7 or only for HEAD/4.8?

BTW, on api.drupal.org, this attribute is still listed, but does not link to anything:

http://api.drupal.org/api/HEAD/file/developer/topics/api/head/file/contr...

gives a page not found error.

chx’s picture

this last minute change has not yet been incorporated into the form API reference. It's rarely needed anyways...

pwolanin’s picture

I'm confused by the discussion above- isn't $form['#submit'] now where one adds additional submit handlers? E.g.:

function comment_form_alter($form_id, &$form) {
  if ($form_id == 'node_type_form' ) {
    $form['#submit']['comment_workflow_form_submit'] = array();
}

this doesn't appears at all in the Forms API documentation

ronaldmulero’s picture

Version: 4.7.0 »
Status: Active » Closed (fixed)

old issue