Commit 213ed89d authored by mfer's avatar mfer

Fixed bug (http://drupal.org/node/88969) where bloginfo user info cleared when...

Fixed bug (http://drupal.org/node/88969) where bloginfo user info cleared when profile.module fields updated for user
parent 099a6546
......@@ -93,17 +93,19 @@ function bloginfo_form_bloginfo($edit, $account, $category) {
/**
* Helper function: insert bloginfo into the database
*/
function bloginfo_save_bloginfo(&$edit, &$user) {
$results = db_query('SELECT uid FROM {bloginfo} WHERE uid = %d', arg(1));
function bloginfo_save_bloginfo(&$edit, &$user, $category) {
if ($category == 'account') {
$results = db_query('SELECT uid FROM {bloginfo} WHERE uid = %d', arg(1));
//This is to update where info already exists in the database
if (db_num_rows($results) == 1){
db_query("Update {bloginfo} SET title = \"%s\", description = \"%s\" WHERE uid = %d", $edit['Title'], $edit['Description'], arg(1));
}
//This is to update where info already exists in the database
if (db_num_rows($results) == 1){
db_query("Update {bloginfo} SET title = \"%s\", description = \"%s\" WHERE uid = %d", $edit['Title'], $edit['Description'], arg(1));
}
//This adds it to the database for the first time
else {
db_query("INSERT INTO {bloginfo} (uid, title, description) VALUES (%d, \"%s\", \"%s\")", arg(1), $edit['Title'], $edit['Description']);
//This adds it to the database for the first time
else {
db_query("INSERT INTO {bloginfo} (uid, title, description) VALUES (%d, \"%s\", \"%s\")", arg(1), $edit['Title'], $edit['Description']);
}
}
}
......
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