nestor44 Posted May 25, 2023 Share Posted May 25, 2023 (edited) Hello, I have a little problem with Activity overview in the Dashboard. It does not showing me any data. All I have are the arrows just like in the screenshot below. I have installed a fresh PS 8.0.1 and it was working with no problem. The Activity overview stopped working either after upgrade from PS 8.0.1 to 8.0.2 or after upgrade from PS 8.0.2 to 8.0.3. Unfortunately, I have not noticed when this happened exactly. I have not upgraded to 8.0.4 yet. When I click on Olnine Visitors in the Activity overview I have Error 500 array_map(): Argument #2 ($array) must be of type array, bool given. in controllers/admin/AdminStatsTabController.php (line 179) protected function getModules() { return array_map( function ($moduleArray) {return ['name' => $moduleArray['module']]; }, Hook::getHookModuleExecList('displayAdminStatsModules') ); } public function displayStats() { In the logs tab I have a following problems: CRITICAL 18:18:14 request Uncaught PHP Exception TypeError: "array_map(): Argument #2 ($array) must be of type array, bool given" at /XXXXX/controllers/admin/AdminStatsTabController.php line 179 { "exception": {} } DEBUG 18:18:12 php Warning: filemtime(): stat failed for /XXXX/admin828entgy6vamtjzorju/themes//template { "exception": { "severity": 2, "file": "/XXXX/classes/controller/AdminController.php", "line": 462, "trace": [ { "file": "/XXXXX/classes/controller/Controller.php", "line": 246, "function": "__construct", "class": "AdminControllerCore", "type": "->" } ], "count": 1 } } I have attached screenshots of entire Debug. I have no iea what happened and how to fix this. Does anyone know how to solve? Edited May 25, 2023 by banan_44 (see edit history) Link to comment Share on other sites More sharing options...
CJH Posted May 27, 2023 Share Posted May 27, 2023 I have exactly the same issue. Exactly, even with the versions (and not yet gone to 8.0.4). I've just been living with it ... Link to comment Share on other sites More sharing options...
ComGrafPL Posted May 27, 2023 Share Posted May 27, 2023 (edited) Have you tried to reset / reinstall dashboard modules? Edited May 27, 2023 by ComGrafPL (see edit history) Link to comment Share on other sites More sharing options...
nestor44 Posted May 27, 2023 Author Share Posted May 27, 2023 9 hours ago, ComGrafPL said: Have you tried to reset / reinstall dashboard modules? Thank you for your reply. I have reset Dashboard Activity module but that did not help. I think the problem with dashboard activity comes from the modules that is responsible for showing the current Online Visitors. The error 500 only appears when I click on Online Visitors. Rest sections of Dashboard Activity are clickble and show no error 500. Only Online Visitors shows error 500. I do not know which module is responsible for Online Visitors. Link to comment Share on other sites More sharing options...
ComGrafPL Posted May 27, 2023 Share Posted May 27, 2023 7 minutes ago, banan_44 said: Thank you for your reply. I have reset Dashboard Activity module but that did not help. I think the problem with dashboard activity comes from the modules that is responsible for showing the current Online Visitors. The error 500 only appears when I click on Online Visitors. Rest sections of Dashboard Activity are clickble and show no error 500. Only Online Visitors shows error 500. I do not know which module is responsible for Online Visitors. Maybe this will help you out. Source data of statistic and other solutions: 1 Link to comment Share on other sites More sharing options...
nestor44 Posted May 27, 2023 Author Share Posted May 27, 2023 24 minutes ago, ComGrafPL said: Maybe this will help you out. Source data of statistic and other solutions: Thank you for this link. The problem is solved. Your link gave me a little hint on which modules I should focus on. It was mentioned to check Google Analytics modules. It turns out that Google Analytics changed the Google Analytics Tracking ID. I hae enebled Google Analytics 4 some time ago but I was not aware that the Tracking ID has changed and GA4 has different ID. I was still using the old UA tracking ID. After inserting the GA4 tracking ID the Dashboard Activity started to work again. But now it show incorrect information regarding New Messages (all messages are read and closed), Product reviews (I have somthing over 300 reviews) and out of stock products (I have a little over 1000 out of stock products). Is there a way to clean up these data to show correct numbers? 1 Link to comment Share on other sites More sharing options...
Erwin00_ Posted August 10, 2023 Share Posted August 10, 2023 I have now three shops with the version 8.0.4. The activity overview works on none of them. One of them is a new clean prestashop installation. I tried every solution for older shops I could find. I think, it has to be a generell problem with prestashop 8. Has anyone found a solution? Link to comment Share on other sites More sharing options...
CJH Posted August 10, 2023 Share Posted August 10, 2023 I'm still on 8.0.3 and still with no overviews working (just spinning circles, never loading). I've tried disabling modules one by one, clearing cache, not found anything to solve this. Link to comment Share on other sites More sharing options...
nestor44 Posted August 28, 2023 Author Share Posted August 28, 2023 My problem is still unresolved yet. I have 5 PS shops as well and all of them have problem with the activity overview. Link to comment Share on other sites More sharing options...
DevCO Posted 12 hours ago Share Posted 12 hours ago Quote When upgrading to PrestaShop 9, many merchants encounter the error “SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id_shop' in WHERE is ambiguous” in the dashactivity module. This happens because several tables (orders, cart, customer, connections, etc.) contain an id_shop column, and the default queries in the module do not always qualify the column with a table alias. The fix is straightforward: open modules/dashactivity/dashactivity.php and update each SQL statement to give the main table an alias (for example o for orders, c for connections, ca for cart) and then pass that alias into Shop::addSqlRestriction(...). This ensures that every condition reads o.id_shop or ca.id_shop instead of the ambiguous id_shop. After patching and clearing cache, the dashboard KPIs load correctly without SQL errors. This small but critical adjustment improves compatibility with PrestaShop 9’s stricter SQL parsing and helps developers maintain multishop-ready code. Below are exact patches you can apply to your file (modules/dashactivity/dashactivity.php) — only the changed lines shown. 1) Visits / unique visitors (first query) Before FROM `' . _DB_PREFIX_ . 'connections` ... ' . Shop::addSqlRestriction(false) After FROM `' . _DB_PREFIX_ . 'connections` c0 ... ' . Shop::addSqlRestriction(false, 'c0') 2) Online visitor list (already OK) You already have: FROM `' . _DB_PREFIX_ . 'connections` c ... ' . Shop::addSqlRestriction(false, 'c') . ' No change needed. 3) Pending orders Before FROM `' . _DB_PREFIX_ . 'orders` o ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER) After FROM `' . _DB_PREFIX_ . 'orders` o ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') 4) Abandoned cart Before FROM `' . _DB_PREFIX_ . 'cart` ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER) After FROM `' . _DB_PREFIX_ . 'cart` ca ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'ca') 5) Returns / exchanges (already OK) You already pass 'o': ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') 6) Active shopping carts Before FROM `' . _DB_PREFIX_ . 'cart` ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER) After FROM `' . _DB_PREFIX_ . 'cart` ca2 ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'ca2') 7) New customers Before FROM `' . _DB_PREFIX_ . 'customer` ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER) After FROM `' . _DB_PREFIX_ . 'customer` c1 ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'c1') 8) New registrations Before FROM `' . _DB_PREFIX_ . 'customer` ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER) After FROM `' . _DB_PREFIX_ . 'customer` c2 ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'c2') 9) Total subscribers Before FROM `' . _DB_PREFIX_ . 'customer` ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER) After FROM `' . _DB_PREFIX_ . 'customer` c3 ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'c3') 10) Product reviews You already have Shop::addSqlAssociation('product','p'). That creates a shop alias named product_shop. If you leave the extra restriction in place, target the shop alias: Before ... ' . Shop::addSqlAssociation('product', 'p') . ' ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER) After ... ' . Shop::addSqlAssociation('product', 'p') . ' ... ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'product_shop') (Alternatively, you can remove that last restriction line entirely since addSqlAssociation already constrains by shop.) 11) getReferer() Before FROM ' . _DB_PREFIX_ . 'connections ... ' . Shop::addSqlRestriction() . ' After FROM ' . _DB_PREFIX_ . 'connections co ... ' . Shop::addSqlRestriction(true, 'co') . ' true is the default, but passing it explicitly is fine. The key is alias 'co'. Final step Clear caches after saving: php bin/console cache:clear --env=dev php bin/console cache:clear --env=prod That should eliminate the Column 'id_shop' in WHERE is ambiguous errors coming from dashactivity. If anything else pops up, paste that specific SQL/fragment and I’ll adjust it the same way. 1 Link to comment Share on other sites More sharing options...
Nickz Posted 11 hours ago Share Posted 11 hours ago 47 minutes ago, DevCO said: 1) Visits / unique visitors (first query) Before you are aware that the post is 2 years old? Link to comment Share on other sites More sharing options...
DevCO Posted 7 hours ago Share Posted 7 hours ago Quote you are aware that the post is 2 years old? True, it’s an old post… but the error is still breaking PrestaShop 9, so here’s the fix. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now