mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 05:02:02 +02:00
Fix for user-extended fields error in mySQL strict mode. Plugin Builder config tweaked.
This commit is contained in:
parent
8c205e3fe5
commit
50998feae3
@ -3184,10 +3184,10 @@ TEMPLATE;
|
||||
|
||||
default:
|
||||
$ret['type'] = 'boolean';
|
||||
$ret['class'] = 'center';
|
||||
$ret['class'] = 'left';
|
||||
$ret['batch'] = false;
|
||||
$ret['filter'] = false;
|
||||
$ret['thclass'] = 'center';
|
||||
$ret['thclass'] = 'left';
|
||||
$ret['width'] = 'auto';
|
||||
$ret['inline'] = false;
|
||||
break;
|
||||
@ -3431,7 +3431,7 @@ class ".$table." extends e_admin_ui
|
||||
if($_POST['pluginPrefs'] && ($vars['mode']=='main'))
|
||||
{
|
||||
$text .= "
|
||||
protected \$prefs = array(";
|
||||
protected \$prefs = array(\n";
|
||||
|
||||
foreach($_POST['pluginPrefs'] as $k=>$val)
|
||||
{
|
||||
@ -3440,7 +3440,7 @@ if($_POST['pluginPrefs'] && ($vars['mode']=='main'))
|
||||
$index = $val['index'];
|
||||
$type = vartrue($val['type'],'text');
|
||||
|
||||
$text .= "\n\t\t\t'".$index."'\t\t=> array('title'=> '".ucfirst($index)."', 'type'=>'".$type."', 'data' => 'string','help'=>'Help Text goes here'),";
|
||||
$text .= "\t\t\t'".$index."'\t\t=> array('title'=> '".ucfirst($index)."', 'type'=>'".$type."', 'data' => 'str','help'=>'Help Text goes here'),\n";
|
||||
}
|
||||
|
||||
}
|
||||
@ -3462,7 +3462,7 @@ $text .= "
|
||||
{
|
||||
if($v['type'] == 'dropdown')
|
||||
{
|
||||
$text .= "\t\t\t\$this->fields['".$k."']['writeParms'] = array('".$k."_0','".$k."_1', '".$k."_2'); // Example Drop-down array. \n";
|
||||
$text .= "\t\t\t\$this->fields['".$k."']['writeParms']['optArray'] = array('".$k."_0','".$k."_1', '".$k."_2'); // Example Drop-down array. \n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -3514,9 +3514,8 @@ $text .= "
|
||||
// optional - a custom page.
|
||||
public function customPage()
|
||||
{
|
||||
\$ns = e107::getRender();
|
||||
\$text = 'Hello World!';
|
||||
\$ns->tablerender('Hello',\$text);
|
||||
return \$text;
|
||||
|
||||
}
|
||||
*/
|
||||
@ -3550,12 +3549,12 @@ $text .= "
|
||||
break;
|
||||
|
||||
case 'write': // Edit Page
|
||||
return \$frm->text('".$fld."',\$curVal);
|
||||
return \$frm->text('".$fld."',\$curVal, 255, 'size=large');
|
||||
break;
|
||||
|
||||
case 'filter':
|
||||
case 'batch':
|
||||
return \$array;
|
||||
return array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -358,9 +358,11 @@ class users_admin_ui extends e_admin_ui
|
||||
$update = array();
|
||||
foreach($this->extended as $key) // Grab Extended field data.
|
||||
{
|
||||
$update[$key] = ($new_data[$key]);
|
||||
$update[$key] = vartrue($new_data[$key],'_NULL_');
|
||||
}
|
||||
|
||||
|
||||
e107::getMessage()->addDebug(print_a($update,true));
|
||||
|
||||
if(!empty($update))
|
||||
{
|
||||
if(!e107::getDb()->count('user_extended', '(user_extended_id)', "user_extended_id=".intval($new_data['submit_value'])))
|
||||
@ -372,8 +374,13 @@ class users_admin_ui extends e_admin_ui
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addError('Extended Fields Update Failed'); //TODO Replace with Generic or existing LAN.
|
||||
e107::getMessage()->addError('Extended Fields Insert Failed'); //TODO Replace with Generic or existing LAN.
|
||||
$error = e107::getDb()->getLastErrorText();
|
||||
e107::getMessage()->addDebug($error);
|
||||
e107::getMessage()->addDebug(print_a($update,true));
|
||||
|
||||
|
||||
e107::getDb()->getLastErrorText();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -382,7 +389,9 @@ class users_admin_ui extends e_admin_ui
|
||||
|
||||
if(e107::getDb()->update('user_extended',$update)===false)
|
||||
{
|
||||
e107::getMessage()->addError('Extended Fields Update Failed'); //TODO Replace with Generic or existing LAN.
|
||||
e107::getMessage()->addError('Extended Fields Update Failed'); //TODO Replace with Generic or existing LAN.
|
||||
$error = e107::getDb()->getLastErrorText();
|
||||
e107::getMessage()->addDebug($error);
|
||||
e107::getMessage()->addDebug(print_a($update,true));
|
||||
|
||||
}
|
||||
|
@ -2343,6 +2343,7 @@ class e_db_mysql
|
||||
case 'pkey' :
|
||||
case 'ukey' :
|
||||
case 'key' :
|
||||
case 'ftkey' :
|
||||
break; // Do nothing with keys for now
|
||||
default :
|
||||
echo "Unexpected field type: {$k} => {$v['type']}<br />";
|
||||
|
@ -452,6 +452,11 @@ class e107_user_extended
|
||||
|
||||
|
||||
// Return the field creation text for a definition
|
||||
/**
|
||||
* @param $type
|
||||
* @param $default
|
||||
* @return bool|string
|
||||
*/
|
||||
function user_extended_type_text($type, $default)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
@ -468,7 +473,7 @@ class e107_user_extended
|
||||
break;
|
||||
|
||||
case EUF_DATE :
|
||||
$db_type = 'DATE NOT NULL';
|
||||
$db_type = 'DATE';
|
||||
break;
|
||||
|
||||
case EUF_TEXTAREA:
|
||||
@ -722,8 +727,8 @@ class e107_user_extended
|
||||
}
|
||||
else
|
||||
{
|
||||
$chk = ($curval == $val)? " checked='checked' " : "";
|
||||
$ret .= "<input id='{$fid}' {$include} type='radio' name='{$fname}' value='{$val}' {$chk} {$required} /> {$label}";
|
||||
$chk = ($curval == $val)? " checked='checked' " : "";
|
||||
$ret .= "<input id='{$fid}' {$include} type='radio' name='{$fname}' value='{$val}' {$chk} {$required} /> {$label}";
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user