diff --git a/includes/form.inc b/includes/form.inc index e7fbb4751f499a8ccdfe6381d8a1bd754dd0a841..6df047161411531764f4b1a71b8e3a0569b4cb50 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -302,9 +302,9 @@ function _form_builder($form_id, $form) { $count++; } - if (function_exists($form['#post_process']) && !isset($form['#post_processed'])) { - $form = call_user_func($form['#post_process'], $form_id, $form, $form_values, $form['#parents']); - $form['#post_processed'] = TRUE; + if (function_exists($form['#after_build']) && !isset($form['#after_build_done'])) { + $form = call_user_func($form['#after_build'], $form, $form_values); + $form['#after_build_done'] = TRUE; } return $form; diff --git a/modules/node.module b/modules/node.module index 1fec44acacf2f229e899823c6cfc6bdd29867a34..d9b725ee43cd572248744d4915196fd2de3d298e 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1663,13 +1663,13 @@ function node_form($node) { } if ($op == t('Preview')) { - $form['#post_process'] = 'node_form_add_preview'; + $form['#after_build'] = 'node_form_add_preview'; } return drupal_get_form($node->type . '_node_form', $form, 'node_form'); } -function node_form_add_preview($form_id, $form, $edit) { +function node_form_add_preview($form, $edit) { $edit = array2object($edit); node_validate($edit); $form['node_preview'] = array('#value' => node_preview($edit), '#weight' => -100); diff --git a/modules/node/node.module b/modules/node/node.module index 1fec44acacf2f229e899823c6cfc6bdd29867a34..d9b725ee43cd572248744d4915196fd2de3d298e 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1663,13 +1663,13 @@ function node_form($node) { } if ($op == t('Preview')) { - $form['#post_process'] = 'node_form_add_preview'; + $form['#after_build'] = 'node_form_add_preview'; } return drupal_get_form($node->type . '_node_form', $form, 'node_form'); } -function node_form_add_preview($form_id, $form, $edit) { +function node_form_add_preview($form, $edit) { $edit = array2object($edit); node_validate($edit); $form['node_preview'] = array('#value' => node_preview($edit), '#weight' => -100); diff --git a/modules/system.module b/modules/system.module index 414e7306dc812633c97887555adfc4bd8c58a791..a2c6e5a11bd311dc64b12936dae5898b77f815b1 100644 --- a/modules/system.module +++ b/modules/system.module @@ -323,7 +323,7 @@ function system_view_general() { '#default_value' => file_directory_path(), '#maxlength' => 255, '#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'), - '#post_process' => 'system_check_directory', + '#after_build' => 'system_check_directory', ); $form['files']['file_directory_temp'] = array( @@ -332,7 +332,7 @@ function system_view_general() { '#default_value' => file_directory_temp(), '#maxlength' => 255, '#description' => t('Location where uploaded files will be kept during previews. Relative paths will be resolved relative to the Drupal installation directory.'), - '#post_process' => 'system_check_directory', + '#after_build' => 'system_check_directory', ); $form['files']['file_downloads'] = array( @@ -466,12 +466,10 @@ function system_view_general() { * fails, the form element is flagged with an error from within the * file_check_directory function. * - * @param $form_id - * The id of the form. * @param $form_element * The form element containing the name of the directory to check. */ -function system_check_directory($form_id, $form_element) { +function system_check_directory($form_element) { file_check_directory($form_element['#value'], FILE_CREATE_DIRECTORY, $form_element['#parents'][0]); return $form_element; } diff --git a/modules/system/system.module b/modules/system/system.module index 414e7306dc812633c97887555adfc4bd8c58a791..a2c6e5a11bd311dc64b12936dae5898b77f815b1 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -323,7 +323,7 @@ function system_view_general() { '#default_value' => file_directory_path(), '#maxlength' => 255, '#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'), - '#post_process' => 'system_check_directory', + '#after_build' => 'system_check_directory', ); $form['files']['file_directory_temp'] = array( @@ -332,7 +332,7 @@ function system_view_general() { '#default_value' => file_directory_temp(), '#maxlength' => 255, '#description' => t('Location where uploaded files will be kept during previews. Relative paths will be resolved relative to the Drupal installation directory.'), - '#post_process' => 'system_check_directory', + '#after_build' => 'system_check_directory', ); $form['files']['file_downloads'] = array( @@ -466,12 +466,10 @@ function system_view_general() { * fails, the form element is flagged with an error from within the * file_check_directory function. * - * @param $form_id - * The id of the form. * @param $form_element * The form element containing the name of the directory to check. */ -function system_check_directory($form_id, $form_element) { +function system_check_directory($form_element) { file_check_directory($form_element['#value'], FILE_CREATE_DIRECTORY, $form_element['#parents'][0]); return $form_element; }