Fix: Removed warning during migrate process
This commit is contained in:
parent
7640752fee
commit
1c9f283e17
@ -216,12 +216,15 @@ class modSociete extends DolibarrModules
|
|||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'";
|
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
while ($obj=$this->db->fetch_object($resql))
|
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||||
{
|
{
|
||||||
$fieldname='extra.'.$obj->name;
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
$fieldlabel=ucfirst($obj->label);
|
{
|
||||||
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
$fieldname='extra.'.$obj->name;
|
||||||
$this->export_entities_array[$r][$fieldname]='company';
|
$fieldlabel=ucfirst($obj->label);
|
||||||
|
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
||||||
|
$this->export_entities_array[$r][$fieldname]='company';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// End add axtra fields
|
// End add axtra fields
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
@ -250,12 +253,15 @@ class modSociete extends DolibarrModules
|
|||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact'";
|
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact'";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
while ($obj=$this->db->fetch_object($resql))
|
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||||
{
|
{
|
||||||
$fieldname='extra.'.$obj->name;
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
$fieldlabel=ucfirst($obj->label);
|
{
|
||||||
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
$fieldname='extra.'.$obj->name;
|
||||||
$this->export_entities_array[$r][$fieldname]='contact';
|
$fieldlabel=ucfirst($obj->label);
|
||||||
|
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
||||||
|
$this->export_entities_array[$r][$fieldname]='contact';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// End add axtra fields
|
// End add axtra fields
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user