Skip to content

Conversation

@iworker
Copy link

@iworker iworker commented Jul 2, 2014

No description provided.

@iworker iworker closed this Jul 2, 2014
@Blacknife Blacknife mentioned this pull request Feb 21, 2017
SamMousa added a commit to SamMousa/yii2-debug that referenced this pull request Mar 5, 2019
When mails fail to serialize all debug panels break due to the summary.
This is shown for a panel that is not the mail panel:
```php
PHP Warning 'yii\base\ErrorException' with message 'count(): Parameter must be an array or an object that implements Countable' 

in /project/vendor/yiisoft/yii2-debug/src/panels/MailPanel.php:111

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'count(): Parame...', '/project/vendor...', 111, Array)
yiisoft#1 /project/vendor/yiisoft/yii2-debug/src/panels/MailPanel.php(111): count(NULL)
yiisoft#2 /project/vendor/yiisoft/yii2-debug/src/views/default/view.php(25): yii\debug\panels\MailPanel->getSummary()
yiisoft#3 /project/vendor/yiisoft/yii2/base/View.php(348): require('/project/vendor...')
yiisoft#4 /project/vendor/yiisoft/yii2/base/View.php(257): yii\base\View->renderPhpFile('/project/vendor...', Array)
yiisoft#5 /project/vendor/yiisoft/yii2/base/View.php(156): yii\base\View->renderFile('/project/vendor...', Array, Object(yii\debug\controllers\DefaultController))
yiisoft#6 /project/vendor/yiisoft/yii2/base/Controller.php(384): yii\base\View->render('view', Array, Object(yii\debug\controllers\DefaultController))
yiisoft#7 /project/vendor/yiisoft/yii2-debug/src/controllers/DefaultController.php(121): yii\base\Controller->render('view', Array)
yiisoft#8 [internal function]: yii\debug\controllers\DefaultController->actionView('5c7e9f3fd6aad', 'router')

```

For the mail panel itself this error is shown:
```php
Exception 'yii\debug\FlattenException' with message 'Serialization of 'Closure' is not allowed' 

in /project/vendor/yiisoft/yii2-debug/src/LogTarget.php:60

Stack trace:
#0 /project/vendor/yiisoft/yii2-debug/src/LogTarget.php(60): serialize(Array)
yiisoft#1 /project/vendor/yiisoft/yii2-debug/src/LogTarget.php(130): yii\debug\LogTarget->export()
yiisoft#2 /project/vendor/yiisoft/yii2/log/Dispatcher.php(189): yii\debug\LogTarget->collect(Array, true)
yiisoft#3 /project/vendor/yiisoft/yii2/log/Logger.php(177): yii\log\Dispatcher->dispatch(Array, true)
yiisoft#4 [internal function]: yii\log\Logger->flush(true)
yiisoft#5 {main}
```

While there is no (good) way to serialize a `Closure`, the very least we can do is have other panels still work.
samdark pushed a commit that referenced this pull request Mar 11, 2019
…s all panels not to render

When mails fail to serialize all debug panels break due to the summary.
This is shown for a panel that is not the mail panel:
```php
PHP Warning 'yii\base\ErrorException' with message 'count(): Parameter must be an array or an object that implements Countable' 

in /project/vendor/yiisoft/yii2-debug/src/panels/MailPanel.php:111

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'count(): Parame...', '/project/vendor...', 111, Array)
#1 /project/vendor/yiisoft/yii2-debug/src/panels/MailPanel.php(111): count(NULL)
#2 /project/vendor/yiisoft/yii2-debug/src/views/default/view.php(25): yii\debug\panels\MailPanel->getSummary()
#3 /project/vendor/yiisoft/yii2/base/View.php(348): require('/project/vendor...')
#4 /project/vendor/yiisoft/yii2/base/View.php(257): yii\base\View->renderPhpFile('/project/vendor...', Array)
#5 /project/vendor/yiisoft/yii2/base/View.php(156): yii\base\View->renderFile('/project/vendor...', Array, Object(yii\debug\controllers\DefaultController))
#6 /project/vendor/yiisoft/yii2/base/Controller.php(384): yii\base\View->render('view', Array, Object(yii\debug\controllers\DefaultController))
#7 /project/vendor/yiisoft/yii2-debug/src/controllers/DefaultController.php(121): yii\base\Controller->render('view', Array)
#8 [internal function]: yii\debug\controllers\DefaultController->actionView('5c7e9f3fd6aad', 'router')

```

For the mail panel itself this error is shown:
```php
Exception 'yii\debug\FlattenException' with message 'Serialization of 'Closure' is not allowed' 

in /project/vendor/yiisoft/yii2-debug/src/LogTarget.php:60

Stack trace:
#0 /project/vendor/yiisoft/yii2-debug/src/LogTarget.php(60): serialize(Array)
#1 /project/vendor/yiisoft/yii2-debug/src/LogTarget.php(130): yii\debug\LogTarget->export()
#2 /project/vendor/yiisoft/yii2/log/Dispatcher.php(189): yii\debug\LogTarget->collect(Array, true)
#3 /project/vendor/yiisoft/yii2/log/Logger.php(177): yii\log\Dispatcher->dispatch(Array, true)
#4 [internal function]: yii\log\Logger->flush(true)
#5 {main}
```

While there is no (good) way to serialize a `Closure`, the very least we can do is have other panels still work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant