Skip to content

Commit

Permalink
Merge pull request PrestaShop#30178 from nicosomb/fix-30173
Browse files Browse the repository at this point in the history
Fixed Stats dashboard when AdminStats module is not enabled
  • Loading branch information
matks authored Nov 10, 2022
2 parents 3571701 + a5c8939 commit 758a34e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions controllers/admin/AdminStatsTabController.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,16 @@ public function checkModulesNames($a, $b): int

protected function getModules()
{
return array_map(
function ($moduleArray) {return ['name' => $moduleArray['module']]; },
Hook::getHookModuleExecList('displayAdminStatsModules')
);
if (true === is_array(Hook::getHookModuleExecList('displayAdminStatsModules'))) {
return array_map(
function ($moduleArray) {
return ['name' => $moduleArray['module']];
},
Hook::getHookModuleExecList('displayAdminStatsModules')
);
}

return [];
}

public function displayStats()
Expand Down

0 comments on commit 758a34e

Please sign in to comment.