Merge pull request #19865 from hregis/fix_avoid_warning
FIX avoid warning
This commit is contained in:
commit
ba404493a2
@ -1215,17 +1215,20 @@ abstract class CommonObject
|
|||||||
public function delete_linked_contact($source = '', $code = '')
|
public function delete_linked_contact($source = '', $code = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
$listId = '';
|
||||||
$temp = array();
|
$temp = array();
|
||||||
$typeContact = $this->liste_type_contact($source, '', 0, 0, $code);
|
$typeContact = $this->liste_type_contact($source, '', 0, 0, $code);
|
||||||
|
|
||||||
foreach ($typeContact as $key => $value) {
|
if (!empty($typeContact)) {
|
||||||
array_push($temp, $key);
|
foreach ($typeContact as $key => $value) {
|
||||||
|
array_push($temp, $key);
|
||||||
|
}
|
||||||
|
$listId = implode(",", $temp);
|
||||||
}
|
}
|
||||||
$listId = implode(",", $temp);
|
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
|
||||||
$sql .= " WHERE element_id = ".((int) $this->id);
|
$sql .= " WHERE element_id = ".((int) $this->id);
|
||||||
if ($listId) {
|
if (!empty($listId)) {
|
||||||
$sql .= " AND fk_c_type_contact IN (".$this->db->sanitize($listId).")";
|
$sql .= " AND fk_c_type_contact IN (".$this->db->sanitize($listId).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user