Commit 03dda455 authored by Dries's avatar Dries

- Patch #37752 by chx and Richard: renamed #post_process to #after_build.

parent cbc92f59
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment