Skip to content

[SOLUTION] Phalcon 4.1.0 - \Profiler::startProfile() must be of the type string, null given #72

@OrangeTanguine

Description

@OrangeTanguine

Hi !
A new bug with the new version of Phalcon (4.1.0).
You can have this error :

Fatal error: Uncaught TypeError: Argument 1 passed to Snowair\Debugbar\Phalcon\Db\Profiler::startProfile() must be of the type string, null given, called in /data/www/project.com/vendor/snowair/phalcon-debugbar/src/PhalconDebugbar.php on line 710 and defined in /data/www/project.com/vendor/snowair/phalcon-debugbar/src/Phalcon/Db/Profiler.php on line 70

You can read the reason in the changelog of phalcon :
https://github.com/phalcon/cphalcon/blob/master/resources/CHANGELOG-4.1.md
Changed Phalcon\Db\Adapter\*::getRealSQLStatement() to return the full SQL query with parameters #12196

SOLUTION :
/vendor/snowair/phalcon-debugbar/src/PhalconDebugbar.php on line 706 change

 $sql = $db->getRealSQLStatement();

to

$sql = $db->getSQLStatement();

And it works ;-)

See you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions