Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Rendering Views With Null Data Throws 500 Not Countable #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ginnwork
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant