When visiting admin/config/development/generate/content or attempt to generate content using drush, the error
Fatal error: Declaration of Drupal\devel_generate\Plugin\DevelGenerate\ContentDevelGenerate::create() must be compatible with Drupal\Core\Plugin\ContainerFactoryPluginInterface::create(Symfony\Component\DependencyInjection\ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) in /~/modules/devel/devel_generate/lib/Drupal/devel_generate/Plugin/DevelGenerate/ContentDevelGenerate.php on line 35

Appears on 8.x-alpha10 or alpha11. Running on VM with Apache 2.4, php 5.5.

CommentFileSizeAuthor
#2 fix-for-container-interface.patch900 bytesmanuelbg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dqd’s picture

confirmed. also appears on latest git clone 8.x by using drush genc (drush v.7.0).
Plus: No devel nor devel generate appears in the admin area so drush is the only option but causes the same error.

manuelbg’s picture

Status: Active » Needs review
FileSize
900 bytes

I change the create definition because the $plugin_definition param as array is not needed.

John_B’s picture

Status: Needs review » Reviewed & tested by the community

The patch works, thank you. Tested in browsers and with drush genc.

It did not apply using git: copy patch to modules/devel, run
git apply -v fix-for-container-interface.patch
returns no output and does not update the file concerned.

Applying the patch using patch command works.

I have also read the code, and have marked the issue RTBC on the assumption that once the change is committed the failure of 'git apply' will not be an issue.

pcambra’s picture

Category: Bug report » Task
Priority: Critical » Normal
Status: Reviewed & tested by the community » Fixed

Thanks for the fix, pushed to 8.x!

  • Commit 71491be on 8.x-1.x authored by manuelbg, committed by pcambra:
    Issue #2251145 by manuelbg | John_B: Fatal error on devel_generate.
    

Status: Fixed » Closed (fixed)

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

Status: Closed (fixed) » Needs work

The last submitted patch, 2: fix-for-container-interface.patch, failed testing.

pcambra’s picture

Status: Needs work » Closed (fixed)