mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
do not end up with an error if no profile fields defined...
git-svn-id: file:///svn/phpbb/trunk@4755 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
7a7cbc14ff
commit
41e56c8fa6
2 changed files with 18 additions and 12 deletions
|
@ -268,16 +268,19 @@ class ucp_profile extends module
|
|||
$db->sql_query($sql);
|
||||
|
||||
// Update Custom Fields
|
||||
$sql = 'UPDATE phpbb_profile_fields_data
|
||||
SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
if (!$db->sql_affectedrows())
|
||||
if (sizeof($cp_data))
|
||||
{
|
||||
$db->return_on_error = true;
|
||||
$cp_data['user_id'] = (int) $user->data['user_id'];
|
||||
$db->sql_query('INSERT INTO phpbb_profile_fields_data ' . $db->sql_build_array('INSERT', $cp_data));
|
||||
$db->return_on_error = false;
|
||||
$sql = 'UPDATE phpbb_profile_fields_data
|
||||
SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
if (!$db->sql_affectedrows())
|
||||
{
|
||||
$db->return_on_error = true;
|
||||
$cp_data['user_id'] = (int) $user->data['user_id'];
|
||||
$db->sql_query('INSERT INTO phpbb_profile_fields_data ' . $db->sql_build_array('INSERT', $cp_data));
|
||||
$db->return_on_error = false;
|
||||
}
|
||||
}
|
||||
|
||||
meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode");
|
||||
|
|
|
@ -190,9 +190,12 @@ class ucp_register extends module
|
|||
$user_id = $db->sql_nextid();
|
||||
|
||||
// Insert Custom Profile Fields
|
||||
$cp_data['user_id'] = (int) $user_id;
|
||||
$sql = 'INSERT INTO phpbb_profile_fields_data ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
|
||||
$db->sql_query($sql);
|
||||
if (sizeof($cp_data))
|
||||
{
|
||||
$cp_data['user_id'] = (int) $user_id;
|
||||
$sql = 'INSERT INTO phpbb_profile_fields_data ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
// Place into appropriate group, either REGISTERED(_COPPA) or INACTIVE(_COPPA) depending on config
|
||||
$group_reg = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED';
|
||||
|
|
Loading…
Add table
Reference in a new issue