yiisoft / yii2-debug

Debug Extension for Yii 2
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
202 stars 149 forks source link

class_exists() error in yii2-debug after upgrade php to 8.1 #482

Closed asadkhalili closed 2 years ago

asadkhalili commented 2 years ago

What steps will reproduce the problem?

I get error after upgrade php to 8.1

What is the expected result?

What do you get instead?

PHP Deprecated Warning – yii\base\ErrorException class_exists(): Passing null to parameter https://github.com/yiisoft/yii2/issues/1 ($class) of type string is deprecated

in /public_html/vendor/yiisoft/yii2-debug/src/panels/UserPanel.phpat line 87 78798081828384858687888990919293949596 { if (!$this->isEnabled() || $this->getUser()->isGuest) { return; } $this->userSwitch = new UserSwitch(['userComponent' => $this->userComponent]); $this->addAccessRules(); if (!is_object($this->filterModel) && class_exists($this->filterModel)

Additional info

Q A
Yii version 2.0.45
PHP version 8.1
Operating system centos
samdark commented 2 years ago

What version of yii-debug do you have?

asadkhalili commented 2 years ago

in composer.json is:

"require-dev": { "yiisoft/yii2-debug": "~2.0.0",

how check version of yii-debug running with terminal?

samdark commented 2 years ago

composer show yiisoft/yii2-debug

asadkhalili commented 2 years ago

name : yiisoft/yii2-debug descrip. : The debugger extension for the Yii framework keywords : debug, debugger, yii2 versions : * 2.0.14 type : yii2-extension license : BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) (OSI approved) https://spdx.org/licenses/BSD-3-Clause.html#licenseText homepage : source : [git] https://github.com/yiisoft/yii2-debug.git dc5a4a8529de1a41dbb037dbabf1f3f93002f21d dist : [zip] https://api.github.com/repos/yiisoft/yii2-debug/zipball/dc5a4a8529de1a41dbb037dbabf1f3f93002f21d dc5a4a8529de1a41dbb037dbabf1f3f93002f21d path : /home/ostadapp/public_html/vendor/yiisoft/yii2-debug names : yiisoft/yii2-debug

samdark commented 2 years ago

Would you please update to 2.1.19? "yiisoft/yii2-debug": "~2.1.0"

asadkhalili commented 2 years ago

thanks, after update error changed to:

Not instantiable – yii\di\NotInstantiableException Failed to instantiate component or class "yii\debug\panels\RequestPanel". ↵ Caused by: ReflectionException Class "yii\debug\panels\RequestPanel" does not exist in /home/ostadapp/public_html/vendor/yiisoft/yii2/di/Container.php at line 507

asadkhalili commented 2 years ago

for view full error please visit this link: http://ostadapp.com

asadkhalili commented 2 years ago

No solution found for this problem?

samdark commented 2 years ago

Not yet.

mikk150 commented 2 years ago

it is fixed in 634b9cc5e89bcc65091fe25ea2b5538b5bc5ce76, so when new release comes out it will be fixed, in the meantime you can use "yiisoft/yii2-debug": "dev-master#5d9ab363e96869e1ff55d85e4aaa942f63d2cc85",