From d86f89a8fa38e356004c7a9e37acd9430437798f Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 4 Jun 2016 17:55:28 +0200 Subject: [PATCH 1/2] fix : #4853 append if not contact type for the element --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3287ac5d4b7..c26251f2312 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -744,7 +744,8 @@ abstract class CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; $sql.= " WHERE element_id = ".$this->id; - $sql.= " AND fk_c_type_contact IN (".$listId.")"; + if ($listId) + $sql.= " AND fk_c_type_contact IN (".$listId.")"; dol_syslog(get_class($this)."::delete_linked_contact", LOG_DEBUG); if ($this->db->query($sql)) From af8e0802f8bd3c7682d1fe6792e8d0cd9f0e654b Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 4 Jun 2016 18:15:52 +0200 Subject: [PATCH 2/2] fix : login required not verified on update --- htdocs/adherents/card.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 66de3be2cc5..be81c9b967d 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -253,7 +253,8 @@ if (empty($reshook)) } $lastname=$_POST["lastname"]; $firstname=$_POST["firstname"]; - $morphy=$morphy=$_POST["morphy"]; + $morphy=$_POST["morphy"]; + $login=$_POST["login"]; if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); @@ -264,7 +265,14 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors'); } - + // Test si le login existe deja + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) + { + if (empty($login)) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Login")), null, 'errors'); + } + } // Create new object if ($result > 0 && ! $error) {