malyshev / yii-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
http://www.yiiframework.com/extension/yii-debug-toolbar/
282 stars 92 forks source link

Rendering Views With Null Data Throws 500 Not Countable #136

Open ginnwork opened 4 years ago

ginnwork commented 4 years ago

I get the following 500 error when using a renderPartial() with no $data parameter: PHP warning: count(): Parameter must be an array or an object that implements Countable.

Stacktrace points to: /var/www/html/protected/extensions/yii-debug-toolbar/views/panels/views.php line 100.

The signature for renderPartial($view, $data=null) specifies $data as optional. The "Views Rendering" panel doesn't account for this and attempts to call count() on null resulting in said 500 error.