From 03dda45573cc585960378ae89701553b11856560 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Mon, 21 Nov 2005 18:10:26 +0000 Subject: [PATCH] - Patch #37752 by chx and Richard: renamed #post_process to #after_build. --- includes/form.inc | 6 +++--- modules/node.module | 4 ++-- modules/node/node.module | 4 ++-- modules/system.module | 8 +++----- modules/system/system.module | 8 +++----- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/includes/form.inc b/includes/form.inc index e7fbb4751f49..6df047161411 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 1fec44acacf2..d9b725ee43cd 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 1fec44acacf2..d9b725ee43cd 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 414e7306dc81..a2c6e5a11bd3 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 414e7306dc81..a2c6e5a11bd3 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; } -- GitLab