#69403 by webchick, adoid overriding #theme set by hook_form_alter().

5.x
Neil Drumm 2006-07-04 08:52:55 +00:00
parent 8d70d932b1
commit c21db64ae8
1 changed files with 8 additions and 5 deletions

View File

@ -145,11 +145,14 @@ function drupal_get_form($form_id, &$form, $callback = NULL) {
}
}
if (theme_get_function($form_id)) {
$form['#theme'] = $form_id;
}
elseif (theme_get_function($callback)) {
$form['#theme'] = $callback;
// Don't override #theme if someone already set it.
if (!isset($form['#theme'])) {
if (theme_get_function($form_id)) {
$form['#theme'] = $form_id;
}
elseif (theme_get_function($callback)) {
$form['#theme'] = $callback;
}
}
if (isset($form['#pre_render'])) {