FIX : export SQL instruction on modProduct with extrafields

This commit is contained in:
Florian HENRY 2015-08-04 11:49:26 +02:00
parent d6776e1155
commit 2a7f5da4a7

View File

@ -252,7 +252,7 @@ class modProduct extends DolibarrModules
if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode'));
// Add extra fields
$import_extrafield_sample=array();
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' entity IN (0, ".$conf->entity.')';
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.')';
$resql=$this->db->query($sql);
if ($resql) // This can fail when class is used on old database (during migration for example)
{