diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
index dad66600d0e3bd387c90a362cd8f4c9678722b14..b88e4b2134fe640051d49981b0999f91d3a3764b 100644
--- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
+++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
@@ -62,7 +62,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
 	 */
 	private function getTitle($action)
 	{
-		global $langs;
+		global $langs,$conf;
 
 		$out='';
 
diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index 91c786b2a1021414bdeb15fc4a8cb89bcfe54b24..4851c8bf82a46d925ef03b496619f2bc846653da 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -138,7 +138,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights
         if ($_POST["userid"] != $object->user_id)  // If link differs from currently in database
         {
             $result=$object->setUserId($_POST["userid"]);
-            if ($result < 0) dol_print_error($object->db,$object->error);
+            if ($result < 0) dol_print_error('',$object->error);
             $_POST['action']='';
             $action='';
         }
@@ -172,7 +172,7 @@ if ($action == 'setsocid')
             if (! $error)
             {
                 $result=$object->setThirdPartyId(GETPOST('socid','int'));
-                if ($result < 0) dol_print_error($object->db,$object->error);
+                if ($result < 0) dol_print_error('',$object->error);
                 $_POST['action']='';
                 $action='';
             }
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 73036747a6c0a3bf8a1f904114fd3c233cda0279..77cbff2918a48cfeb0a3c82ef2d7aae246111551 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -95,6 +95,8 @@ class Adherent extends CommonObject
     var $first_subscription_date;
     var $first_subscription_amount;
     var $last_subscription_date;
+    var $last_subscription_date_start;
+    var $last_subscription_date_end;
     var $last_subscription_amount;
     var $subscriptions=array();
 
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 66f7508fa20f775cf5ee857d4a086122afbccc8e..9fbe5ea3d6a6706c3df6d6d363c182463481442e 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -99,8 +99,10 @@ class AdherentType extends CommonObject
      */
     function update($user)
     {
-    	global $hookmanager;
-    	
+    	global $hookmanager,$conf;
+
+    	$error=0;
+
         $this->libelle=trim($this->libelle);
 
         $sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
@@ -119,7 +121,7 @@ class AdherentType extends CommonObject
         	// Actions on extra fields (by external module or standard code)
         	$hookmanager->initHooks(array('membertypedao'));
         	$parameters=array('membertype'=>$this->id);
-        	$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
+        	$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,'update');    // Note that $action and $object may have been modified by some hooks
         	if (empty($reshook))
         	{
         		if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
@@ -132,8 +134,8 @@ class AdherentType extends CommonObject
         		}
         	}
         	else if ($reshook < 0) $error++;
-        	
-        	
+
+
             return 1;
         }
         else