If the core module "comment" is disable, the drush command generate the following fatal error :

root@dd16d1b8b4d3:/var/www/html/docroot# drush generate-realistic
PHP Fatal error:  Call to undefined function comment_save() in /var/www/html/docroot/sites/all/modules/contrib/devel/devel_generate/devel_generate.inc on line 180

This is due to the $info['max_comments'] = 5; in RealisticDummyContentDevelGenerateGenerator.php.

I think it is necessary to check if the module "comment" is enable before to add this element in $info array.

Comments

Nixou created an issue. See original summary.

nixou’s picture

StatusFileSize
new783 bytes

Attached is the patch I used to solve this problem.

alberto56’s picture

Thanks @Nixou, I just pushed a modification to the test which should fail due to the comment issue, https://github.com/dcycle/realistic_dummy_content/compare/master...2887307

This should theoretically fail at https://circleci.com/gh/dcycle/realistic_dummy_content/46, then your patch should make things work again, at which point I'll merge it in.

alberto56’s picture

Here is a version of the patch which is compatible with Drupal 7 and 8, and which has some automated test coverage.

  • alberto56 committed 5a7a9dd on 8.x-2.x
    Issue #2887307 by Nixou, alberto56: Avoid fatal error if core module "...

  • alberto56 committed 5a7a9dd on 7.x-2.x
    Issue #2887307 by Nixou, alberto56: Avoid fatal error if core module "...
alberto56’s picture

Status: Active » Fixed

Thanks for this, @Nixou, committed and fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.