From cf5a17ca0dc9f24f913b54ea87fc6ba23c0a355d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 10 Jun 2003 19:00:48 +0000 Subject: [PATCH] Patch be Matt Westgate: - Bugfix: in the user_admin_edit() function, the data array returned from the callback modules was not being merged into the edit array. - Bugfix: added enctype="multipart/form-data" to the form tag so that we can update things like the avatar image in the admin interface. --- modules/user.module | 5 +++-- modules/user/user.module | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/user.module b/modules/user.module index 5129eb5570a..3c307043f34 100644 --- a/modules/user.module +++ b/modules/user.module @@ -1013,6 +1013,7 @@ function user_edit($edit = array()) { $output .= form_submit(t("Save user information")); $output = form($output, "post", 0, "enctype=\"multipart/form-data\""); + // the "enctype" attribute is required to upload files such as avatars } else { $output = user_login(); @@ -1480,7 +1481,7 @@ function user_admin_edit($edit = array()) { unset($edit["pass1"], $edit["pass2"]); if (!$error) { - $account = user_save($account, $edit); + $account = user_save($account, array_merge($edit, $data)); $output .= status(t("your user information changes have been saved.")); } else { @@ -1527,7 +1528,7 @@ function user_admin_edit($edit = array()) { $output .= form_submit(t("Save account")); $output .= form_submit(t("Delete account")); - $output = form($output); + $output = form($output, "post", 0, "enctype=\"multipart/form-data\""); } else { diff --git a/modules/user/user.module b/modules/user/user.module index 5129eb5570a..3c307043f34 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1013,6 +1013,7 @@ function user_edit($edit = array()) { $output .= form_submit(t("Save user information")); $output = form($output, "post", 0, "enctype=\"multipart/form-data\""); + // the "enctype" attribute is required to upload files such as avatars } else { $output = user_login(); @@ -1480,7 +1481,7 @@ function user_admin_edit($edit = array()) { unset($edit["pass1"], $edit["pass2"]); if (!$error) { - $account = user_save($account, $edit); + $account = user_save($account, array_merge($edit, $data)); $output .= status(t("your user information changes have been saved.")); } else { @@ -1527,7 +1528,7 @@ function user_admin_edit($edit = array()) { $output .= form_submit(t("Save account")); $output .= form_submit(t("Delete account")); - $output = form($output); + $output = form($output, "post", 0, "enctype=\"multipart/form-data\""); } else {