Skip to content
Snippets Groups Projects
Commit 983efdd6 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX repair tool was ko to restore extrafields with type select.

parent 2aae4ea6
No related branches found
No related tags found
No related merge requests found
...@@ -252,10 +252,34 @@ if ($ok) ...@@ -252,10 +252,34 @@ if ($ok)
if (! in_array($code,array_keys($arrayoffieldsfound))) if (! in_array($code,array_keys($arrayoffieldsfound)))
{ {
print 'Found field '.$code.' declared into '.MAIN_DB_PREFIX.'extrafields table but not found into desc of table '.$tableextra." -> "; print 'Found field '.$code.' declared into '.MAIN_DB_PREFIX.'extrafields table but not found into desc of table '.$tableextra." -> ";
$type=$extrafields->attribute_type[$code]; $value=$extrafields->attribute_size[$code]; $attribute=''; $default=''; $extra=''; $null='null'; $type=$extrafields->attribute_type[$code]; $length=$extrafields->attribute_size[$code]; $attribute=''; $default=''; $extra=''; $null='null';
if ($type=='boolean') {
$typedb='int';
$lengthdb='1';
} elseif($type=='price') {
$typedb='double';
$lengthdb='24,8';
} elseif($type=='phone') {
$typedb='varchar';
$lengthdb='20';
}elseif($type=='mail') {
$typedb='varchar';
$lengthdb='128';
} elseif (($type=='select') || ($type=='sellist') || ($type=='radio') ||($type=='checkbox') ||($type=='chkbxlst')){
$typedb='text';
$lengthdb='';
} elseif ($type=='link') {
$typedb='int';
$lengthdb='11';
} else {
$typedb=$type;
$lengthdb=$length;
}
$field_desc=array( $field_desc=array(
'type'=>$type, 'type'=>$typedb,
'value'=>$value, 'value'=>$lengthdb,
'attribute'=>$attribute, 'attribute'=>$attribute,
'default'=>$default, 'default'=>$default,
'extra'=>$extra, 'extra'=>$extra,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment