# Uncaught PHP Exception FatalThrowableError Call to a member function getCount()

**URL:** https://forum.mautic.org/t/uncaught-php-exception-fatalthrowableerror-call-to-a-member-function-getcount/21771
**Category:** Product Support
**Tags:** mautic-4
**Created:** [November 25, 2021, 7:43am UTC](https://forum.mautic.org/t/uncaught-php-exception-fatalthrowableerror-call-to-a-member-function-getcount/21771 "2021-11-25T07:43:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)
#### Post date: [November 25, 2021, 7:43am UTC](https://forum.mautic.org/t/uncaught-php-exception-fatalthrowableerror-call-to-a-member-function-getcount/21771/1 "2021-11-25T07:43:03Z")

</div>

**Your software**  
My Mautic version is: 4.0.2  
My PHP version is:  
Zend Engine v3.4.0, Copyright (c) Zend Technologies  
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

My Database type and version is:  
mysql Ver 8.0.27-0ubuntu0.20.04.1 for Linux on x86\_64

**Your problem**  
My problem is:  
When i off CORS in settings and back on it i see Error 500 on dashboard. But i can enter in settings or reports or /campaigns… Bugs only with dashboard.  
after enabling and disabling CORS, I still tried to enter the isits published Pages report and I was able to do it. did not wait for the download and switched to the dashboard. The 500 error may have been caused by a report. I still cannot enter it

These errors are showing in the log:  
mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: “Call to a member function getCount() on int” at /home/master/m.everest-dom.com/app/bundles/StatsBundle/Aggregate/Calculator.php line 187 {“exception”:"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function getCount() on int at ./app/bundles/StatsBundle/Aggregate/Calculator.php:187)"}

Steps I have tried to fix the problem:  
php bin/console mautic:cache:clear  
rm -rf app/cache/\*  
but no resolve ☹

---

<div class="post-metadata">

### Author: ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)
#### Post date: [November 25, 2021, 7:55am UTC](https://forum.mautic.org/t/uncaught-php-exception-fatalthrowableerror-call-to-a-member-function-getcount/21771/2 "2021-11-25T07:55:22Z")

</div>

may be this

> <https://stackoverflow.com/questions/58213618/call-to-a-member-function-count-on-int-in-laravel>

resolve it bug?

---

<div class="post-metadata">

### Author: ![shailemalla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shailemalla/32/1394_2.png) [@shailemalla](https://forum.mautic.org/u/shailemalla)
#### Post date: [November 25, 2021, 8:07am UTC](https://forum.mautic.org/t/uncaught-php-exception-fatalthrowableerror-call-to-a-member-function-getcount/21771/3 "2021-11-25T08:07:15Z")

</div>

I had a similar problem. Everything was working except for dashboard.  
You may need to reset your desktop widgets params from the database one by one and see which widget is causing this problem.

see this post: [Mautic crashed: internal server error after editing dashboard “Best email read hours” widget - Support - Mautic Community Forums](https://forum.mautic.org/t/mautic-crashed-internal-server-error-after-editing-dashboard-best-email-read-hours-widget/21758/4)

Here’s how I fixed that:

SSH into your server.

1 .Fist login as root user in your mysql.

```auto
sudo mysql -u root

```

1. Replace `mautic-database-name` with your own mautic database name and run this in mysql interface:

```auto
USE mautic-database-name;

```

1. Print widgets table:

```auto
SELECT * FROM widgets;

```

1. find out the ID of the widget that is broken and update its params, in my case the ID of the widget was 7, so:

```auto
UPDATE widgets SET params = "a:0:{}" WHERE id = 7;

```

Repeat step 4 for your all widgets one be one, starting for the widget you suspect is causing problems.

You can also do all this from phpmyadmin if you have that installed.

Thanks
