Closed fimak closed 10 years ago
what version that you are used? provide your configurasion and error trace.
inside the composer.json:
"require": {
"yiisoft/yii2": "*",
"mdmsoft/yii2-admin": "*"
inside the common/config/mian.php:
return [
'modules' => [
'admin' => [
'class' => 'mdm\admin\Module',
]
...
],
...
'components' => [
....
'authManager' => [
'class' => 'yii\rbac\DbManager',
]
],
'as access' => [
'class' => 'mdm\admin\components\AccessControl',
'allowActions' => [
'admin/*',
]
],
];
Error trace:
Invalid Configuration – yii\base\InvalidConfigException
Missing required parameter "id" when instantiating "mdm\admin\Module".
1. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/di/Container.php at line 444
435436437438439440441442443444445446447448449450 protected function resolveDependencies($dependencies, $reflection = null)
{
foreach ($dependencies as $index => $dependency) {
if ($dependency instanceof Instance) {
if ($dependency->id !== null) {
$dependencies[$index] = $this->get($dependency->id);
} elseif ($reflection !== null) {
$name = $reflection->getConstructor()->getParameters()[$index]->getName();
$class = $reflection->getName();
throw new InvalidConfigException("Missing required parameter \"$name\" when instantiating \"$class\".");
}
}
}
return $dependencies;
}
}
2. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/di/Container.php – yii\di\Container::resolveDependencies([yii\di\Instance, null, []], ReflectionClass) at line 363
3. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/di/Container.php – yii\di\Container::build('mdm\admin\Module', [], []) at line 147
4. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/di/Container.php – yii\di\Container::get('mdm\admin\Module') at line 440
5. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/di/Container.php – yii\di\Container::resolveDependencies([yii\di\Instance, ['allowActions' => ['admin/*']]], ReflectionClass) at line 363
6. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/di/Container.php – yii\di\Container::build('mdm\admin\components\AccessContr...', [], ['allowActions' => ['admin/*']]) at line 147
7. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/BaseYii.php – yii\di\Container::get('mdm\admin\components\AccessContr...', [], ['allowActions' => ['admin/*']]) at line 344
8. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/base/Component.php – yii\BaseYii::createObject(['class' => 'mdm\admin\components\AccessContr...', 'allowActions' => ['admin/*']]) at line 180
9. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/BaseYii.php – yii\base\Component::__set('as access', ['class' => 'mdm\admin\components\AccessContr...', 'allowActions' => ['admin/*']]) at line 518
10. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/base/Object.php – yii\BaseYii::configure(yii\web\Application, ['extensions' => ['yiisoft/yii2-swiftmailer' => ['name' => 'yiisoft/yii2-swiftmailer', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/swiftmailer' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-codeception' => ['name' => 'yiisoft/yii2-codeception', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/codeception' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-bootstrap' => ['name' => 'yiisoft/yii2-bootstrap', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/bootstrap' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-debug' => ['name' => 'yiisoft/yii2-debug', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/debug' => '/home/fimak/web/tradesimple/vend...']], ...], 'components' => ['cache' => ['class' => 'yii\caching\FileCache'], 'request' => ['enableCookieValidation' => true, 'enableCsrfValidation' => true, 'cookieValidationKey' => 'xxxxxxx', 'class' => 'yii\web\Request'], 'authManager' => ['class' => 'yii\rbac\DbManager'], 'db' => ['class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=trad...', 'username' => 'root', 'password' => 'toor', ...], ...], 'modules' => ['admin' => ['class' => 'mdm\admin\Module'], 'crm' => ['class' => 'app\modules\crm\Module'], 'debug' => 'yii\debug\Module', 'gii' => 'yii\gii\Module'], 'as access' => ['class' => 'mdm\admin\components\AccessContr...', 'allowActions' => ['admin/*']], ...]) at line 105
11. in /home/fimak/web/tradesimple/vendor/yiisoft/yii2/base/Application.php – yii\base\Object::__construct(['extensions' => ['yiisoft/yii2-swiftmailer' => ['name' => 'yiisoft/yii2-swiftmailer', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/swiftmailer' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-codeception' => ['name' => 'yiisoft/yii2-codeception', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/codeception' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-bootstrap' => ['name' => 'yiisoft/yii2-bootstrap', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/bootstrap' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-debug' => ['name' => 'yiisoft/yii2-debug', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/debug' => '/home/fimak/web/tradesimple/vend...']], ...], 'components' => ['cache' => ['class' => 'yii\caching\FileCache'], 'request' => ['enableCookieValidation' => true, 'enableCsrfValidation' => true, 'cookieValidationKey' => 'xxxxxxx', 'class' => 'yii\web\Request'], 'authManager' => ['class' => 'yii\rbac\DbManager'], 'db' => ['class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=trad...', 'username' => 'root', 'password' => 'toor', ...], ...], 'modules' => ['admin' => ['class' => 'mdm\admin\Module'], 'crm' => ['class' => 'app\modules\crm\Module'], 'debug' => 'yii\debug\Module', 'gii' => 'yii\gii\Module'], 'as access' => ['class' => 'mdm\admin\components\AccessContr...', 'allowActions' => ['admin/*']], ...]) at line 202
12. in /home/fimak/web/tradesimple/backend/web/index.php – yii\base\Application::__construct(['vendorPath' => '/home/fimak/web/tradesimple/vend...', 'extensions' => ['yiisoft/yii2-swiftmailer' => ['name' => 'yiisoft/yii2-swiftmailer', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/swiftmailer' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-codeception' => ['name' => 'yiisoft/yii2-codeception', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/codeception' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-bootstrap' => ['name' => 'yiisoft/yii2-bootstrap', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/bootstrap' => '/home/fimak/web/tradesimple/vend...']], 'yiisoft/yii2-debug' => ['name' => 'yiisoft/yii2-debug', 'version' => '2.0.0.0-RC', 'alias' => ['@yii/debug' => '/home/fimak/web/tradesimple/vend...']], ...], 'components' => ['cache' => ['class' => 'yii\caching\FileCache'], 'request' => ['enableCookieValidation' => true, 'enableCsrfValidation' => true, 'cookieValidationKey' => 'xxxxxxx'], 'authManager' => ['class' => 'yii\rbac\DbManager'], 'db' => ['class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=trad...', 'username' => 'root', 'password' => 'toor', ...], ...], 'modules' => ['admin' => ['class' => 'mdm\admin\Module'], 'crm' => ['class' => 'app\modules\crm\Module'], 'debug' => 'yii\debug\Module', 'gii' => 'yii\gii\Module'], ...])
what minimum-stability
of your composer.json
?
"minimum-stability": "beta",
got it. beta
is expired. use dev
version.
"minimum-stability": "dev",
or change "mdmsoft/yii2-admin": "*" to "mdmsoft/yii2-admin": "dev-master"
Thanks.
hi i am having same problem. for "minimum-stability": "RC", i used "mdmsoft/yii2-admin": "@dev". it downloaded but error occur. what to do?
@ivancse58 how about "mdmsoft/yii2-admin": "dev-master"?
Getting the same here with mdmsoft/yii2-admin (dev-master 6973eca) config:
'components' => [
'i18n' => [
'translations' => [
'rbac-admin' => [
'class' => 'mdm\admin\Module',
'sourceLanguage' => 'en',
'basePath' => '@mdm/admin/messages'
]
]
],
],
'modules' => [
'authManager' => [
'class' => 'yii\rbac\DbManager',
],
'admin' => [
'class' => 'mdm\admin\Module',
'layout' => 'left-menu', // default to null. other avaliable value 'right-menu' and 'top-menu'
'controllerMap' => [
'assignment' => [
'class' => 'mdm\admin\controllers\AssignmentController',
'userClassName' => 'common\models\User',
'idField' => 'id'
]
],
'menus' => [
'assignment' => [
'label' => 'Grand Access' // change label
],
'route' => null, // disable menu
],
],
],
I get error "Missing required parameter "id" when instantiating "mdm\admin\Module"." when try to install this module. I have installed it how it described in instruction.