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

Not possible to create entry from CLI #1562

Closed
intoeetive opened this issue Mar 23, 2017 · 0 comments
Closed

Not possible to create entry from CLI #1562

intoeetive opened this issue Mar 23, 2017 · 0 comments
Assignees
Labels

Comments

@intoeetive
Copy link

intoeetive commented Mar 23, 2017

Description

It's not possible to create entry with console command because of dependancy on getUser() function which does not exist for console app

Steps to reproduce

  1. Write console controller with this code

    $entry = new Entry(['authorId' => 1]);
    $entry->title = 'test';
    $entry->sectionId = 1;
    Craft::$app->getElements()->saveElement($entry);
  2. Run controller function from CLI

  3. Get this error:

    Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: craft\console\Application::getUser()'

Additional info

  • Craft version: Craft Pro 3.0.0-beta.7
  • PHP version: 7.1.0
  • Database driver & version: MySQL 5.5.53
  • Plugins & versions:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants