I freshly installed Drupal 9.4.8 a few days ago. I was following the instructions on how to generate temporary content for testing from this video and received a fatal error. I need to know how to fix the error so I can generate some temporary content.
The steps to reproduce
1 Install devel module
Use composer to install the module. According to the docs this should work with Drupal 9.
composer require 'drupal/devel:^5.0'
In the drupal admin/modules control panel, install Devel and Devel Generate.
2 Go to drupal admin/config to generate content
visit admin/config and click Generate Content option. Select your desired content types -- in my case, custom Events and User Groups content types. I specified these settings:
- generate 50 nodes
- go back 1 year
- 2 words per title
All other settings are default.
Click Generate.
THIS PRODUCES THE PROBLEM
In my browser, all I see is this:
The website encountered an unexpected error. Please try again later.
I looked in the apache log and see this error message:
[Tue Nov 01 15:11:22.216372 2022] [proxy_fcgi:error] [pid 344518:tid 140018374911744] [client 127.0.0.1:39852] AH01071: Got error 'PHP message: Error: Class 'Drush\Utils\StringUtils' not found in /var/www/example/public/modules/contrib/devel/devel_generate/src/Plugin/DevelGenerate/ContentDevelGenerate.php on line 391 #0 /var/www/example/public/modules/contrib/devel/devel_generate/src/Form/DevelGenerateForm.php(95): Drupal\devel_generate\Plugin\DevelGenerate\ContentDevelGenerate->settingsFormValidate()\n#1 [internal function]: Drupal\devel_generate\Form\DevelGenerateForm->validateForm()\n#2 /var/www/example/public/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array()\n#3 /var/www/example/public/core/lib/Drupal/Core/Form/FormValidator.php(275): Drupal\Core\Form\FormValidator->executeValidateHandlers()\n#4 /var/www/example/public/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm()\n#5 /var/www/example/public/core/lib/Drupal/Core/Form/FormBuilder.php(588): Drupal\Core\Form\FormValidator->validateForm()\n#6 /var/www/example/public/core/lib/Drupal/Core/Form/FormBuilder.php(...', referer: http://example.com/admin/config/development/generate/content
I'm not at all sure, but it looks like there is some prerequisite expected by Devel which I do not have. I'd appreciate anyone telling me the best way to fix this fatal error.