Drupal-console: generate:entity:content - PHP Fatal error

Created on 3 May 2017  路  6Comments  路  Source: hechoendrupal/drupal-console

The drupal generate:entity:content command throws the following error

PHP Fatal error: Call to a member function getPath() on null in [...]/vendor/drupal/console/src/Generator/EntityContentGenerator.php on line 84

Drupal 8.3.1
Drupal Console version 1.0.0-rc18

Most helpful comment

Module should be generated before using it.

That is why baba is not valid.

When passing --module example is this example module a valid module?

We need to validate if the passed module is not valid and trigger an exception instead of continue execution and ask more questions.

All 6 comments

@extravio I just ran it and it works:

drupal-generate-entity-content

Are you passing arguments/parameters when executing the command?

That's another issue: I have to specify --module, otherwise I get an error
[ERROR] Value "example" is invalid
dc_error1
here's the screenshot of the error
dc_error2
I tried on both an existing project and a fresh install

Module should be generated before using it.

That is why baba is not valid.

When passing --module example is this example module a valid module?

We need to validate if the passed module is not valid and trigger an exception instead of continue execution and ask more questions.

Thanks! I thought the module would be created automatically as part of the entity generation.
All working now.

Would it be easy to alter the message (sent with the exception) to be more helpful in terms of understainding why "Value 'xxx' is invalid"?

@rpsu we have already improved it some versions ago.

Was this page helpful?
0 / 5 - 0 ratings