From 55e7989552c07a328e82c5ee214d2964225dfe75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Sep 2018 09:42:30 +0200 Subject: [PATCH] FIX #9043 --- htdocs/core/modules/DolibarrModules.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 47a5761f7c6..0809649a9da 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1417,6 +1417,8 @@ class DolibarrModules // Can not be abstract, because we need to insta $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; + $sql.= " AND test = 1"; // We delete on lines that are not set with a complete test that is '$conf->module->enabled' so when module is disabled, the cron is also removed. + // For crons declared with a '$conf->module->enabled', there is no need to delete the line, so we don't loose setup if we reenable module. dol_syslog(get_class($this)."::delete_cronjobs", LOG_DEBUG); $resql=$this->db->query($sql);