|
废话不多说,直接上代码吧
/shared/libraries/Field_behavior.php
当字段类型为text(wysiwyg or wysiwyg_basic)时,程序中还指定了默认值
这样就语法错误了
直接注释掉default那一行就可以解决了
PHP复制代码
/**
* 生成字段的创建信息
*
* @access public
* @param string
* @param string
* @return array
*/
public function on_info ($data, $oldname = '')
{
if ($this->_is_extra ($data['type']))
{
$this->_load_extra_field ($data['type']);
$field = $this->_extra_fields [$data['type']]->on_info($data);
}
else
{
switch ($data['type'])
{
case 'select_from_model' :
case 'radio_from_model':
case 'int' : $field = array(
'type' => 'INT',
'constraint' => $data['length'] ? $data['length'] : 10 ,
'default' => 0
) ;
break;
case 'float' : $field = array(
'type' => 'FLOAT',
'constraint' => $data['length'] ? $data['length'] : 10,
'default' => 0
) ;
break;
case 'input' :
case 'select':
case 'radio' :
case 'checkbox':
case 'checkbox_from_model':
case 'datetime':
case 'colorpicker':
case 'linked_menu':
case 'textarea' :
$field = array(
'type' => 'VARCHAR',
'constraint' => $data['length'] ? $data['length'] : 100 ,
'default' => ''
) ;
break;
case 'wysiwyg' :
case 'wysiwyg_basic':
$field = array(
'type' => 'TEXT',
//'default' => ''
) ;
break;
}
}
if ($oldname != '')
{
$field['name'] = $data['name'];
return array($oldname => $field);
}
else
{
return array($data['name'] => $field);
}
} 复制代码 |
|