Prestashop version: 1.7.6.7
PHP: 7.2CLI
Recently my client's prestashop has stopped showing any data on the dashboard(attachment below).
And when debugging i found that the consule outputs an error
QuoteUncaught TypeError: window[data_type] is not a function
at Object.success (dashboard.js:58)
Now with further digging i found that AdminDashboardController is not returning any ajax data. What gets resulted is a html page of the index page which basically means that the post request is not being processed in the backend at all.
The function
Quotepublic function ajaxProcessRefreshDashboard()
{
$id_module = null;
if ($module = Tools::getValue('module')) {
$module_obj = Module::getInstanceByName($module);
if (Validate::isLoadedObject($module_obj)) {
$id_module = $module_obj->id;
}
}
$params = array(
'date_from' => $this->context->employee->stats_date_from,
'date_to' => $this->context->employee->stats_date_to,
'compare_from' => $this->context->employee->stats_compare_from,
'compare_to' => $this->context->employee->stats_compare_to,
'dashboard_use_push' => (int) Tools::getValue('dashboard_use_push'),
'extra' => (int) Tools::getValue('extra'),
);
die(json_encode(Hook::exec('dashboardData', $params, $id_module, true, true, (int) Tools::getValue('dashboard_use_push'))));
}
works but the results are not returned.
I've been messing around with it for some time now without success so ithought maybe someone could shed some light on my situation. I'm pretty new to prestashop to be honest and also i wasn't really sure if this is a bug really so i didn't want to post it on bug's forum