Merge pull request #1465 from marcosgdf/bug-1295

Fixed bug 1295: Error when creating an agenda extrafield with a number as reference
This commit is contained in:
Laurent Destailleur 2014-03-11 11:45:50 +01:00
commit 324402be0d
3 changed files with 3 additions and 2 deletions

View File

@ -40,6 +40,7 @@ Fix: [ bug #520 ] Product statistics and detailed lists are wrong.
Fix: [ bug #1240 ] traduction.
Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation.
Fix: [ bug #1280 ] service with not end of date was tagged as expired.
Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference
***** ChangeLog for 3.5 compared to 3.4.* *****
For users:

View File

@ -985,7 +985,7 @@ class DoliDBMysql extends DoliDB
{
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
$sql= "ALTER TABLE ".$table." ADD `".$field_name."` ";
$sql.= $field_desc['type'];
if(preg_match("/^[^\s]/i",$field_desc['value']))
if (! in_array($field_desc['type'],array('date','datetime')))

View File

@ -979,7 +979,7 @@ class DoliDBMysqli extends DoliDB
{
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
$sql= "ALTER TABLE ".$table." ADD `".$field_name."` ";
$sql.= $field_desc['type'];
if(preg_match("/^[^\s]/i",$field_desc['value']))
if (! in_array($field_desc['type'],array('date','datetime')))