summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 55910c175..cd2e5b9eb 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -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'])) {