1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fix for extended user fields created via "Quick Add User"

This commit is contained in:
Cameron 2016-04-11 15:19:05 -07:00
parent 9960a905e8
commit 9629bd4510
2 changed files with 13 additions and 1 deletions

View File

@ -506,11 +506,14 @@ class users_admin_ui extends e_admin_ui
e107::getUserExt()->addFieldTypes($update);
e107::getMessage()->addDebug(print_a($new_data,true));
if(!empty($update))
{
if(!e107::getDb()->count('user_extended', '(user_extended_id)', "user_extended_id=".intval($new_data['submit_value'])))
{
$update['user_extended_id'] = intval($new_data['submit_value']);
$update['data']['user_extended_id'] = intval($new_data['submit_value']);
if(e107::getDb()->insert('user_extended', $update))
{
e107::getMessage()->addSuccess('Extended Fields Updated'); //TODO Replace with Generic or existing LAN.
@ -1399,6 +1402,8 @@ class users_admin_ui extends e_admin_ui
$userid = $sql->insert('user', $allData);
if ($userid)
{
$this->saveExtended(array('submit_value'=>$userid));
$sysuser = e107::getSystemUser(false, false);
$sysuser->setData($allData['data']);
$sysuser->setId($userid);

View File

@ -867,6 +867,7 @@ class e_db_mysql
if($REPLACE === false)
{
$query = "INSERT INTO `".$this->mySQLPrefix."{$table}` ({$keyList}) VALUES ({$valList})";
}
else
{
@ -1220,6 +1221,12 @@ class e_db_mysql
*/
private function _getPDOValue($type, $fieldValue)
{
if($fieldValue == '_NULL_')
{
$type = 'null';
}
switch($type)
{
case "int":