Espo CRM Ver 10.0, the unread notification counter repeatedly returns an Error.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • admin@vistouso.com
    Junior Member
    • Jul 2026
    • 2

    #1

    Espo CRM Ver 10.0, the unread notification counter repeatedly returns an Error.

    On a fresh Espo CRM Version 10.0 installation, the unread notification counter repeatedly returns an Internal Server Error.

    Endpoint:
    GET /Notification/action/notReadCount

    Log:
    [2026-07-04 15:06:43] CRITICAL: (0) :: GET /Notification/action/notReadCount
    [object] (UnexpectedValueException(code: 0): at
    /application/Espo/Tools/Notification/RecordService.php:303)

    The error repeats every few seconds because the frontend retries the unread notification count request.

    Environment:
    - EspoCRM: v10.0.0
    - PHP: 8.5.6
    - MySQL: 8.0.33
    - Database driver: pdo_mysql
    - New/fresh installation
    - No customisations or extensions installed

    Cause:
    In application/Espo/Tools/Notification/RecordService.php, the query result for COUNT() is returned as a numeric string by the database driver, but the code requires it to be strictly an integer:

    $count = $row['c'] ?? null;

    if (!is_int($count)) {
    throw new UnexpectedValueException();
    }

    return $count;



    Temporary workaround that resolved the issue:

    $count = $row['c'] ?? null;

    if (!is_numeric($count)) {
    throw new UnexpectedValueException();
    }

    return (int) $count;

    Expected behaviour:
    The notification unread-count endpoint should accept numeric COUNT() results returned as strings by PDO/MySQL and return an integer without a server error.

    Please consider casting the count result to int, or allowing numeric values before casting.

    Any permanent solution or work around will be much appreciated as the above will change if any update or upgrade is carried out.
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9945

    #2
    It's interesting. As of PHP 8.1 PDO by default returns respective types rather than string. And it's not possible to configure otherwise other than through the code if I'm not mistaken.

    Comment

    Working...