diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 8cef23ff28207..fc8fc9ada5489 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -318,7 +318,7 @@ public function executeHooks($method, $parameters = array(), &$object = null, &$ // Hooks that must return int (hooks with type 'addreplace') if ($hooktype == 'addreplace') { // @phan-suppress-next-line PhanUndeclaredMethod The method's existence is tested above. - $resactiontmp = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) + $resactiontmp = (int) $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) $resaction += $resactiontmp; if ($resactiontmp < 0 || !empty($actionclassinstance->error) || (!empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) {