diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ff014031df3..d1fe12f5fcc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4961,6 +4961,11 @@ abstract class CommonObject // phpcs:enable global $langs,$conf; + if (! is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers. + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; + $langs = new Translate('', $conf); + } + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers($trigger_name, $this, $user, $langs, $conf);