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

Creating console command for a module throws error #3

Closed
wants to merge 1 commit into from

Conversation

nilsenpaul
Copy link

@nilsenpaul nilsenpaul commented Dec 14, 2022

On trying to generate a console command for a module, I get the following error after entering the command ID:

Exception 'yii\base\InvalidArgumentException' with message 'The default value must begin with the base namespace (modules\\site).'

This is because $options['default'] is normalized and doesn't contain \\ anymore, while $this->baseNamespace does. Normalizing the base namespace prevents this from happening.

Description

Related issues

… module

On trying to generate a console command for a module, I get the following error after entering the command ID:

`Exception 'yii\base\InvalidArgumentException' with message 'The default value must begin with the base namespace (modules\\site).'`

This is because `$options['default']` is normalized and doesn't contain `\\` anymore, while $this->baseNamespace does. Normalizing the base namespace prevents this from happening.
@nilsenpaul nilsenpaul changed the title Prevent error from being thrown when creating a console command for a… Creating console command for a module throws error Dec 14, 2022
@brandonkelly
Copy link
Member

Looks like maybe the plugin/module’s autoload root was configured with double-escaped backslashes. Just released v1.0.2 with guards for that (ed78d21).

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.

2 participants