yii-debug-toolbar icon indicating copy to clipboard operation
yii-debug-toolbar copied to clipboard

Rendering Views With Null Data Throws 500 Not Countable

Open ginnwork opened this issue 4 years ago • 0 comments

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.

ginnwork avatar May 13 '20 08:05 ginnwork