Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception 'TypeError' with message 'Argument 1 passed to MigrationController::preparePathDirectory() must be of the type string, array given #55

Closed
tonykor opened this issue Jul 30, 2019 · 3 comments
Assignees

Comments

@tonykor
Copy link

tonykor commented Jul 30, 2019

I'm getting an error

# php yii migration/create-all
Exception 'TypeError' with message 'Argument 1 passed to bizley\migration\controllers\MigrationController::preparePathDirectory() must be of the type string, array given, called in /basic/vendor/bizley/migration/src/controllers/MigrationController.php on line 295'

in /basic/vendor/bizley/migration/src/controllers/MigrationController.php:321

Stack trace:
#0 /basic/vendor/bizley/migration/src/controllers/MigrationController.php(295): bizley\migration\controllers\MigrationController->preparePathDirectory(Array)
#1 /basic/vendor/yiisoft/yii2/base/Controller.php(155): bizley\migration\controllers\MigrationController->beforeAction(Object(yii\base\InlineAction))
#2 /basic/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('create-all', Array)
#3 /basic/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('create-all', Array)
#4 /basic/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migration/creat...', Array)
#5 /basic/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migration/creat...', Array)
#6 /basic/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#7 /basic/yii(19): yii\base\Application->run()
#8 {main}

config

      'migration' => [
            'class' => 'bizley\migration\controllers\MigrationController',
            'migrationPath' => [
                '@console/migrations',               
                '@yii/rbac/migrations',
            ]
        ],
@bizley bizley self-assigned this Jul 30, 2019
@bizley bizley added the bug label Jul 30, 2019
@bizley
Copy link
Owner

bizley commented Jul 30, 2019

The same applies to migrationNamespace.

@bizley
Copy link
Owner

bizley commented Jul 31, 2019

After thinking of it a bit more yesterday - this is not a bug. These properties are clearly stated to be strings so you can not put array there only because property of the same name but in different class can be array. So I'm removing bug label.

At the same time we need to have some way of adding arrays for migration updater and this should be what the issue is about. Anyway, result will be the same.

@bizley bizley added enhancement and removed bug labels Jul 31, 2019
@bizley
Copy link
Owner

bizley commented Aug 1, 2019

Added in 3.5.0/2.8.0

@bizley bizley closed this as completed Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants