Onethink cannot create a new editor type field under MySQL
Clone the latest code is installed, inherits the base document, adds the Detaildesc field to the editor type, and does not have a new table. And the SQL statement is wrong
The main reason is that mysql5.x is not allowed to have a default value for a field of type Blob/text, and the temporary fix code is admin/controller/attributecontroller.class.php
protected function Updatefield ($field) { //Check whether the table exists $table _exist = $this->checktableexist ($field [' Model_ ID ']); Get the original field name $last _field = $this->getfieldbyid ($field [' id '], ' name '); /* Get default value 1, mysql5.x is not allowed Blob/text Type field has default value of 2, because MySQL is in ' strict Mode ' strict mode, if changed to non-strict mode, the above statement can be executed successfully 3, mysql5.x under Windows is the default to ' strict mode ', when executing the above statement, will give you an error or warning message */ if (Strpos (Strtolower ($field [' field ']), ' text ') >=0) { $default = '; } else{ $default = $field [' Value ']!= '? "DEFAULT". $field [' value ']. "'": '; } $sql = <<<sql ALTER TABLE ' {$this->table_name} ' change COLUMN ' {$last _field} ' {$field [' name ']} ' {$field ["field"]} {$default} COMMENT ' {$field ["title"]} '; SQL; $res = M ()->execute ($sql); return $res!== false; }
Onethink cannot create a new editor Type field under MySQL