yii2 - An Error occurred while handling another error: - yii2

I am trying to implement Metronic Theme to my Yii-2 advanced application's backend. I followed the instructions on GitHub step by step, however I keep getting a blank page with the following error on it. I am truly stuck.
Here is the error:
An Error occurred while handling another error:
Error: Call to undefined method yii\base\ErrorException::getSeverity() in
C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\ErrorHandler.php:287
Stack trace:
#0 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\ErrorHandler.php(107):
yii\base\ErrorHandler->logException(Object(yii\base\ErrorException))
#1 [internal function]: yii\base\ErrorHandler-
>handleException(Object(yii\base\ErrorException))
#2 {main}
Previous exception:
yii\base\ErrorException: Illegal string offset 'id' in
C:\xampp\htdocs\advanced\vendor\dlds\yii2-metronic\widgets\NavBar.php:59
Stack trace:
#0 C:\xampp\htdocs\advanced\vendor\dlds\yii2-
metronic\widgets\NavBar.php(59): yii\base\ErrorHandler->handleError(2,
'Illegal string ...', 'C:\\xampp\\htdocs...', 59, Array)
#1 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Object.php(107):
dlds\metronic\widgets\NavBar->init()
#2 [internal function]: yii\base\Object->__construct(Array)
#3 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\di\Container.php(381):
ReflectionClass->newInstanceArgs(Array)
#4 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\di\Container.php(156):
yii\di\Container->build('dlds\\metronic\\w...', Array, Array)
#5 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\BaseYii.php(348):
yii\di\Container->get('dlds\\metronic\\w...', Array, Array)
#6 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Widget.php(89):
yii\BaseYii::createObject(Array)
#7 C:\xampp\htdocs\advanced\backend\views\layouts\main.php(47):
yii\base\Widget::begin(Array)
#8 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\View.php(330):
require('C:\\xampp\\htdocs...')
#9 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\View.php(250):
yii\base\View->renderPhpFile('C:\\xampp\\htdocs...', Array)
#10 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Controller.php(396):
yii\base\View->renderFile('C:\\xampp\\htdocs...', Array,
Object(dektrium\user\controllers\SecurityController))
#11 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Controller.php(382):
yii\base\Controller->renderContent('\n\n <div clas...')
#12 C:\xampp\htdocs\advanced\vendor\dektrium\yii2-
user\controllers\SecurityController.php(166): yii\base\Controller-
>render('login', Array)
#13 [internal function]: dektrium\user\controllers\SecurityController-
>actionLogin()
#14 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\InlineAction.php(57):
call_user_func_array(Array, Array)
#15 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Controller.php(156):
yii\base\InlineAction->runWithParams(Array)
#16 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Module.php(523):
yii\base\Controller->runAction('login', Array)
#17 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\web\Application.php(102):
yii\base\Module->runAction('user/security/l...', Array)
#18 C:\xampp\htdocs\advanced\vendor\yiisoft\yii2\base\Application.php(380):
yii\web\Application->handleRequest(Object(yii\web\Request))
#19 C:\xampp\htdocs\advanced\admin\index.php(15): yii\base\Application-
>run()
#20 {main}

You must add 'error' on actions
'rules' => [
[
'actions' => ['error', ...

Related

C:\xampp\htdocs\blueberry-test\wp-includes\script-loader.php on line 2407

Fatal error: Uncaught Error: Call to undefined function get_current_screen() in C:\xampp\htdocs\blueberry-test\wp-includes\script-loader.php:2407 Stack trace: #0 C:\xampp\htdocs\blueberry-test\wp-includes\class-wp-hook.php(307): wp_global_styles_render_svg_filters('') #1 C:\xampp\htdocs\blueberry-test\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #2 C:\xampp\htdocs\blueberry-test\wp-includes\plugin.php(476): WP_Hook->do_action(Array) #3 C:\xampp\htdocs\blueberry-test\wp-includes\general-template.php(3074): do_action('wp_body_open') #4 C:\xampp\htdocs\blueberry-test\wp-content\themes\blueberrys\header-home.php(35): wp_body_open() #5 C:\xampp\htdocs\blueberry-test\wp-includes\template.php(770): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\blueberry-test\wp-includes\template.php(716): load_template('C:\xampp\htdocs...', true, Array) #7 C:\xampp\htdocs\blueberry-test\wp-includes\general-template.php(48): locate_template(Array, true, true, Array) #8 C:\xampp\htdocs\blueberry-test\wp-content\themes\blueberrys\inc\woocommerce\storefront-woocommerce-template-functions.php(9): get_header('home') #9 C:\xampp\htdocs\blueberry-test\wp-content\themes\blueberrys\functions.php(47): require('C:\xampp\htdocs...') #10 C:\xampp\htdocs\blueberry-test\wp-settings.php(566): include('C:\xampp\htdocs...') #11 C:\xampp\htdocs\blueberry-test\wp-config.php(96): require_once('C:\xampp\htdocs...') #12 C:\xampp\htdocs\blueberry-test\wp-load.php(50): require_once('C:\xampp\htdocs...') #13 C:\xampp\htdocs\blueberry-test\wp-admin\admin.php(34): require_once('C:\xampp\htdocs...') #14 C:\xampp\htdocs\blueberry-test\wp-admin\plugins.php(10): require_once('C:\xampp\htdocs...') #15 {main} thrown in C:\xampp\htdocs\blueberry-test\wp-includes\script-loader.php on line 2407
Please at the description and format your code to code.

Exception 'ReflectionException' with message 'Class ingelby\toolbox\helpers\PublicIdBehavior does not exist' in yii2 advance

i am getting this error.
Exception 'ReflectionException' with message 'Class ingelby\toolbox\helpers\PublicIdBehavior does not exist'
in D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\di\Container.php:428
Stack trace:
#0 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\di\Container.php(428): ReflectionClass->__construct('ingelby\\toolbox...')
#1 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\di\Container.php(364): yii\di\Container->getDependencies('ingelby\\toolbox...')
#2 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\di\Container.php(156): yii\di\Container->build('ingelby\\toolbox...', Array, Array)
#3 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\BaseYii.php(349): yii\di\Container->get('ingelby\\toolbox...', Array, Array)
#4 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\Component.php(750): yii\BaseYii::createObject(Array)
#5 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\Component.php(734): yii\base\Component->attachBehaviorInternal(2, Array)
#6 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\Component.php(603): yii\base\Component->ensureBehaviors()
#7 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\db\BaseActiveRecord.php(925): yii\base\Component->trigger('init')
#8 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\BaseObject.php(109): yii\db\BaseActiveRecord->init()
#9 [internal function]: yii\base\BaseObject->__construct(Array)
#10 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\di\Container.php(375): ReflectionClass->newInstanceArgs(Array)
#11 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\di\Container.php(156): yii\di\Container->build('frontend\\models...', Array, Array)
#12 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\BaseYii.php(345): yii\di\Container->get('frontend\\models...', Array)
#13 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\StaticInstanceTrait.php(37): yii\BaseYii::createObject('frontend\\models...')
#14 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\db\ActiveQuery.php(447): yii\base\Model::instance()
#15 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\db\ActiveQuery.php(146): yii\db\ActiveQuery->buildJoinWith()
#16 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\db\QueryBuilder.php(227): yii\db\ActiveQuery->prepare(Object(yii\db\mysql\QueryBuilder))
#17 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\db\ActiveQuery.php(316): yii\db\QueryBuilder->build(Object(yii\db\ActiveQuery))
#18 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\db\Query.php(237): yii\db\ActiveQuery->createCommand(Object(yii\db\Connection))
#19 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\db\ActiveQuery.php(133): yii\db\Query->all(NULL)
#20 D:\xamppnew\htdocs\nfsp\frontend\models\Event.php(86): yii\db\ActiveQuery->all()
#21 D:\xamppnew\htdocs\nfsp\frontend\controllers\SiteController.php(212): frontend\models\Event::getEvents(Array, 50976)
#22 [internal function]: frontend\controllers\SiteController->actionIndex()
#23 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#24 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#25 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('', Array)
#26 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\web\Application.php(103): yii\base\Module->runAction('', Array)
#27 D:\xamppnew\htdocs\nfsp\vendor\yiisoft\yii2\base\Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#28 D:\xamppnew\htdocs\nfsp\frontend\web\index.php(18): yii\base\Application->run()
#29 {main}
please help me to solve this problem.
It looks like you are missing a package in a folder vendor.
Try to execute command "composer install".
if it doesn’t help, show please composer.

Error occur after composer require

I ran composer require 2amigos/yii2-multi-select-widget "*" and after my site went down
An Error occurred while handling another error:
yii\base\InvalidArgumentException: Invalid path alias: #dektrium/rbac/views in C:\xampp\htdocs\webster\vendor\yiisoft\yii2\BaseYii.php:154
Stack trace:
#0 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\Theme.php(144): yii\BaseYii::getAlias('#dektrium/rbac/...')
#1 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\View.php(228): yii\base\Theme->applyTo('C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\web\ErrorHandler.php(266): yii\base\View->renderFile('C:\\xampp\\htdocs...', Array, Object(yii\web\ErrorHandler))
#3 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\web\ErrorHandler.php(126): yii\web\ErrorHandler->renderFile('#yii/views/erro...', Array)
#4 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\base\InvalidArgumentException))
#5 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\base\InvalidArgumentException))
#6 {main}
Previous exception:
yii\base\InvalidArgumentException: Invalid path alias: #dektrium/rbac/views in C:\xampp\htdocs\webster\vendor\yiisoft\yii2\BaseYii.php:154
Stack trace:
#0 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\Theme.php(144): yii\BaseYii::getAlias('#dektrium/rbac/...')
#1 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\View.php(228): yii\base\Theme->applyTo('C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\View.php(156): yii\base\View->renderFile('C:\\xampp\\htdocs...', Array, Object(backend\controllers\SiteController))
#3 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\Controller.php(384): yii\base\View->render('index', Array, Object(backend\controllers\SiteController))
#4 C:\xampp\htdocs\webster\backend\controllers\SiteController.php(65): yii\base\Controller->render('index')
#5 [internal function]: backend\controllers\SiteController->actionIndex()
#6 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#7 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#8 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('', Array)
#9 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\web\Application.php(103): yii\base\Module->runAction('', Array)
#10 C:\xampp\htdocs\webster\vendor\yiisoft\yii2\base\Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#11 C:\xampp\htdocs\webster\backend\web\index.php(18): yii\base\Application->run()
#12 {main}
It is all that I did. Nothing more nothing less. Just tried to install multi-select and my site went down. Why is that? What can cause this? I tried to remove it composer remove 2amigos/yii2-multi-select-widget and nothing happen. I am totally shocked. Please give me advice!

yii2 select column from relation table trouble

i want choose all devlopers table data , with only "username" column in User table
i write this but i get error
$model = Developers::find()->select('*')->with(['users' => function($q){
$q->select('username');
}])->asArray()->all();
my Developers "developer_id" column have relation with User table id column
so in Developers model i wrote
public function getUsers()
{
return $this->hasOne(User::className(), ['id' => 'developer_id']);
}
error is
PHP Notice 'yii\base\ErrorException' with message 'Undefined index: id'
in /srv/http/adone/vendor/yiisoft/yii2/db/ActiveRelationTrait.php:501
Stack trace:
#0 /srv/http/adone/vendor/yiisoft/yii2/db/ActiveRelationTrait.php(501): yii\base\ErrorHandler->handleError(8, 'Undefined index...', '/srv/http/adone...', 501, Array)
#1 /srv/http/adone/vendor/yiisoft/yii2/db/ActiveRelationTrait.php(381): yii\db\ActiveQuery->getModelKey(Array, Array)
#2 /srv/http/adone/vendor/yiisoft/yii2/db/ActiveRelationTrait.php(245): yii\db\ActiveQuery->buildBuckets(Array, Array)
#3 /srv/http/adone/vendor/yiisoft/yii2/db/ActiveQueryTrait.php(174): yii\db\ActiveQuery->populateRelation('users', Array)
#4 /srv/http/adone/vendor/yiisoft/yii2/db/ActiveQuery.php(214): yii\db\ActiveQuery->findWith(Array, Array)
#5 /srv/http/adone/vendor/yiisoft/yii2/db/Query.php(214): yii\db\ActiveQuery->populate(Array)
#6 /srv/http/adone/vendor/yiisoft/yii2/db/ActiveQuery.php(135): yii\db\Query->all(NULL)
#7 /srv/http/adone/controllers/admin/SiteAdminController.php(30): yii\db\ActiveQuery->all()
#8 [internal function]: app\controllers\admin\SiteAdminController->actionViewDevelopers()
#9 /srv/http/adone/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /srv/http/adone/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#11 /srv/http/adone/vendor/yiisoft/yii2/base/Module.php(523): yii\base\Controller->runAction('view-developers', Array)
#12 /srv/http/adone/vendor/yiisoft/yii2/web/Application.php(102): yii\base\Module->runAction('admin/site-admi...', Array)
#13 /srv/http/adone/vendor/yiisoft/yii2/base/Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#14 /srv/http/adone/web/index.php(12): yii\base\Application->run()
#15 {main}
why this happened?
Try this:
Developers::find()->select('developers.*, user.username')->joinWith(['users'])->asArray()->all()

Yii2 migration configException error

Suddenly any of the migration command is not working in my project and i don't know why. following is the errors in cmd.
C:\wamp64\www\project>yii migrate
Exception 'yii\base\InvalidConfigException' with message 'Failed to instantiate component or class "user".'
in C:\wamp64\www\project\vendor\yiisoft\yii2\di\Instance.php:139
Stack trace:
#0 C:\wamp64\www\project\vendor\yiisoft\yii2\filters\AccessControl.php(100): yii\di\Instance::ensure(Object(yii\di\Instance), 'yii\\web\\User')
#1 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Object.php(107): yii\filters\AccessControl->init()
#2 [internal function]: yii\base\Object->__construct(Array)
#3 C:\wamp64\www\project\vendor\yiisoft\yii2\di\Container.php(381): ReflectionClass->newInstanceArgs(Array)
#4 C:\wamp64\www\project\vendor\yiisoft\yii2\di\Container.php(156): yii\di\Container->build('yii\\filters\\Acc...', Array, Array)
#5 C:\wamp64\www\project\vendor\yiisoft\yii2\BaseYii.php(348): yii\di\Container->get('yii\\filters\\Acc...', Array, Array)
#6 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Component.php(183): yii\BaseYii::createObject(Array)
#7 C:\wamp64\www\project\vendor\yiisoft\yii2\BaseYii.php(529): yii\base\Component->__set('beforeRequest', Array)
#8 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Object.php(105): yii\BaseYii::configure(Object(yii\console\Application), Array)
#9 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Application.php(205): yii\base\Object->__construct(Array)
#10 C:\wamp64\www\project\vendor\yiisoft\yii2\console\Application.php(89): yii\base\Application->__construct(Array)
#11 C:\wamp64\www\project\yii(26): yii\console\Application->__construct(Array)
#12 {main}
Please help me to solve it.