FIX to avoid error during upgrade with pgsql (#30443)

This commit is contained in:
Regis Houssin 2024-07-24 20:32:32 +02:00 committed by GitHub
parent ed5dfc2a21
commit df932f7fea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -523,10 +523,12 @@ class modSociete extends DolibarrModules
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel;
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel;
}
}
}
// Add extra fields
@ -695,10 +697,12 @@ class modSociete extends DolibarrModules
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_updatekeys_array[$r][$fieldname] = $fieldlabel;
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_updatekeys_array[$r][$fieldname] = $fieldlabel;
}
}
}
// Add profids as criteria to search duplicates
@ -759,10 +763,12 @@ class modSociete extends DolibarrModules
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel;
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel;
}
}
}
// Add extra fields
@ -837,10 +843,12 @@ class modSociete extends DolibarrModules
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_updatekeys_array[$r][$fieldname] = $fieldlabel;
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_updatekeys_array[$r][$fieldname] = $fieldlabel;
}
}
}