Fix error: class ConfigurationUpdate not found

Created on 17 January 2024, 5 months ago
Updated 13 May 2024, about 2 months ago

Problem/Motivation

I wanted to generate a config update with "drush generate config-update".
After answering the given questions, I got the following exception:

Error: Class "Drupal\update_helper\Generators\ConfigurationUpdate" not found in /var/www/html/docroot/modules/contrib/update_helper/modules/update_helper_checklist/src/Events/CommandGcuSubscriber.php on line 122 #0 [internal function]: Drupal\update_helper_checklist\Events\CommandGcuSubscriber->onExecute()
#1 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#2 /var/www/html/docroot/modules/contrib/update_helper/src/Drush/Generators/ConfigurationUpdateGenerator.php(195): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#3 /var/www/html/vendor/chi-teck/drupal-code-generator/src/Command/BaseGenerator.php(113): Drupal\update_helper\Drush\Generators\ConfigurationUpdateGenerator->generate()
#4 /var/www/html/vendor/symfony/console/Command/Command.php(326): DrupalCodeGenerator\Command\BaseGenerator->execute()
#5 /var/www/html/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run()
#6 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#7 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#8 /var/www/html/vendor/drush/drush/src/Commands/generate/GenerateCommands.php(105): Symfony\Component\Console\Application->run()
#9 [internal function]: Drush\Commands\generate\GenerateCommands->generate()
#10 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#11 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#12 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#13 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#14 /var/www/html/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#15 /var/www/html/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()
#16 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#17 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#18 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#19 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#20 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()
#21 /var/www/html/vendor/drush/drush/drush(4): require('...')
#22 /var/www/html/vendor/bin/drush(119): include('...')
#23 {main}
Error: Class "Drupal\update_helper\Generators\ConfigurationUpdate" not found in Drupal\update_helper_checklist\Events\CommandGcuSubscriber->onExecute() (line 122 of /var/www/html/docroot/modules/contrib/update_helper/modules/update_helper_checklist/src/Events/CommandGcuSubscriber.php).

In this case i use Drush 12 and Drupal 10.2.x.

Steps to reproduce

I used the "drush generate config-update" and answering the given questions on the command.

By default the config update file will be created, but here is still the exception from upper.

Proposed resolution

I found out that the class "Drupal\update_helper\Generators\ConfigurationUpdate" is no longer present.

The function "getUpdateFunctionName(...)" ist present in the class "Drupal\update_helper\Drush\Generators\ConfigurationUpdateGenerator", so i used this class instead.

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany PLK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024