Child pages
  • [debugger] The "resource" type variables aren't handled by "Debugger::print_r" method [5.2.1]
Skip to end of metadata
Go to start of metadata

When attempt is made to display resource-type variable in the debugger the following notice happens and nothing is displayed to the user:

Warning: strlen() expects parameter 1 to be string, resource given in .../core/kernel/utility/debugger.php on line 534

Solution

Handle resource-type variables by casting them to string. The Var Dumper Symfony's component is doing more then that (see https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/VarDumper/Caster/ResourceCaster.php), but we're not using it yet. The [composer] Use Symfony's VarDumper for Template Parser debugging discussion is about that.

After the fix resource is displayed in debugger like this:

Related Tasks

INP-1433 - Getting issue details... STATUS