diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5306300e7b1..bc0f4519b59 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -933,7 +933,14 @@ if (count($listofextcals)) // Complete $eventarray with events coming from external module $parameters=array(); $object=null; $reshook=$hookmanager->executeHooks('getCalendarEvents',$parameters,$object,$action); -if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($eventarray, $hookmanager->resArray['eventarray']); +if (! empty($hookmanager->resArray['eventarray'])) { + foreach ($hookmanager->resArray['eventarray'] as $keyDate => $events) { + if (!isset($eventarray[$keyDate])) { + $eventarray[$keyDate]=array(); + } + $eventarray[$keyDate]=array_merge($eventarray[$keyDate], $events); + } +}