Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
See function drupal_process_form (form.inc), the following part:
if ($form_state['submitted'] && !form_get_errors() && !$form_state['rebuild']) {
// Execute form submit handlers.
form_execute_handlers('submit', $form, $form_state);
When I create a form programmatically and make it ready to be submitted, I notice that it fails because the submitted is FALSE by default.
The following can be found in drupal_form_submit
// Programmed forms are always submitted.
$form_state['submitted'] = TRUE;
Judging from above, $form_state['submitted'] has the meaning 'If TRUE, the form must be submitted'.
But this is in conflict with the documentation about the form_state (documentation of drupal_build_form):
* - submitted: If TRUE, the form has been submitted. Defaults to FALSE.
What does the submitted property really mean?
Comments
Comment #1
mgiffordYou're looking for more than - http://api.drupal.org/api/drupal/includes!form.inc/function/form_execute... - I assume.