Drush command generate-content(alias genc) doesn't validate if the content-types entered in the --type parameter --type exists in the Drupal database or not.

drush genc 2 --type=some_random_content_type_that_doesnt_exist

It goes ahead and creates the content that will not have a content type entry in the node tables. So I think it should validate the content types before actually creating the content.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gokulnk’s picture

Providing a patch that checks if the content types entered are present in the Drupal database and shows an appropriate Error Message.

chakrapani’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.
Though a more specific check can be added to identify the wrong content type, it can be a overkill.
one other suggestion is you could print available content types when there is an error.

making it RTBC as the above suggestions are optional and suggested features.

Regards
Chakrapani R

moshe weitzman’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

There are an endless number of validations that can be added to a program. CLI apps like Drush generally come without safety belts.