diff --git a/core/triggers/interface_99_modPropalehistory_propalehistory.class.php b/core/triggers/interface_99_modPropalehistory_propalehistory.class.php index 2d2a7c4..85b74b7 100644 --- a/core/triggers/interface_99_modPropalehistory_propalehistory.class.php +++ b/core/triggers/interface_99_modPropalehistory_propalehistory.class.php @@ -116,7 +116,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf //echo $action.'
'; if ($action == 'PROPAL_CREATE') { // only for clone proposal and if version number is used - if ($object->context['createfromclone'] == 'createfromclone' && !empty($object->array_options['options_propalehistory_version_num'])) { + if (isset($object->context['createfromclone']) == 'createfromclone' && !empty($object->array_options['options_propalehistory_version_num'])) { $object->array_options['options_propalehistory_version_num'] = null; // reset version number $result = $object->insertExtraFields(); if ($result < 0) { @@ -128,7 +128,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf } elseif ($action == 'PROPAL_VALIDATE' && $conf->global->PROPALEHISTORY_AUTO_ARCHIVE) { dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); - define('INC_FROM_DOLIBARR', true); + //define('INC_FROM_DOLIBARR', true); dol_include_once("/propalehistory/config.php"); dol_include_once("/comm/propal/class/propal.class.php"); dol_include_once('/propalehistory/class/propaleHist.class.php');