diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47ffeb5e28f8f..3296110422cca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: rev: v4.5.0 hooks: - id: no-commit-to-branch - args: [--branch, develop, --pattern, \d+.0] + args: [--branch, develop, --pattern, \d+.0$] - id: check-yaml args: [--unsafe] - id: check-json diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 055a24ac5fd7c..d6bd08b6223db 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3998,7 +3998,7 @@ public function fetchObjectLinked($sourceid = null, $sourcetype = '', $targetid $num = $this->db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); if ($justsource || $justtarget) { if ($justsource) { $this->linkedObjectsIds[$obj->targettype][$obj->rowid] = $obj->fk_target; @@ -4058,8 +4058,12 @@ public function fetchObjectLinked($sourceid = null, $sourcetype = '', $targetid $classpath = 'adherents/class'; $module = 'adherent'; } elseif ($objecttype == 'contact') { - $module = 'societe'; - } + $module = 'societe'; + } elseif ($objecttype == 'action') { + $module = 'agenda'; + $subelement = 'actionComm'; + } + // Set classfile $classfile = strtolower($subelement); $classname = ucfirst($subelement);