Drupal从10.1.8升级至10.2.6时autoconfigure配置错误求助
我要把Drupal从10.1.8(已停止安全维护)升级到10.2.6,按要求先升级了Drush,再执行命令:
composer update "drupal/core-*" --with-all-dependencies
采用Core-recommended模板,升级过程无异常,但网站直接报错:
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The configuration key "autoconfigure" cannot be used to define a default value in "core/core.services.yml". Allowed keys are "public", "tags", "autowire". in Drupal\Core\DependencyInjection\YamlFileLoader->parseDefaults() (line 161 of /var/www/suneris/web/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php)
我试着把core/core.services.yml里的autoconfigure键改成autowire:true,结果Drush无法正常工作,又出现新报错:
Symfony\Component\DependencyInjection\Exception\RuntimeException: Invalid service "plugin.manager.help_section": method "Drupal\help\HelpSectionManager::setSearchManager()" does not exist. in Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->getReflectionMethod() (line 218 of /var/www/suneris/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php)
后来尝试回滚到10.1.8版本也无法解决问题,特此求助。
附当前composer.json配置:
{"name": "drupal/recommended-project","description": "Project template for Drupal projects with a relocated document root","type": "project","license": "GPL-2.0-or-later","homepage": "https://www.drupal.org/project/drupal","support": {"docs": "https://www.drupal.org/docs/user_guide/en/index.html","chat": "https://www.drupal.org/node/314178"},"repositories": [{"type": "composer","url": "https://packages.drupal.org/8"}],"require": {"composer/installers": "^2.0","defuse/php-encryption": "^2.4","drupal/animated_gif": "^2.0","drupal/captcha": "^2.0","drupal/core-composer-scaffold": "^10.2","drupal/core-project-message": "^10.2","drupal/core-recommended": "^10.2","drupal/dxpr_theme": "^5.2","drupal/metatag": "^1.26","drupal/recaptcha": "^3.2","drush/drush": "^12.2"},"conflict": {"drupal/drupal": "*"},"minimum-stability": "stable","prefer-stable": true,"config": {"allow-plugins": {"composer/installers": true,"drupal/core-composer-scaffold": true,"drupal/core-project-message": true,"phpstan/extension-installer": true,"dealerdirect/phpcodesniffer-composer-installer": true,"php-http/discovery": true},"sort-packages": true},"extra": {"drupal-scaffold": {"locations": {"web-root": "web/"}},"installer-paths": {"web/core": ["type:drupal-core"],"web/libraries/{$name}": ["type:drupal-library"],"web/modules/contrib/{$name}": ["type:drupal-module"],"web/profiles/contrib/{$name}": ["type:drupal-profile"],"web/themes/contrib/{$name}": ["type:drupal-theme"],"drush/Commands/contrib/{$name}": ["type:drupal-drush"],"web/modules/custom/{$name}": ["type:drupal-custom-module"],"web/profiles/custom/{$name}": ["type:drupal-custom-profile"],"web/themes/custom/{$name}": ["type:drupal-custom-theme"]},"drupal-core-project-message": {"include-keys": ["homepage","support"],"post-create-project-cmd-message": ["<bg=blue;fg=white> </>","<bg=blue;fg=white> Congratulations, you’ve installed the Drupal codebase </>","<bg=blue;fg=white> from the drupal/recommended-project template! </>","<bg=blue;fg=white> </>","","<bg=yellow;fg=black>Next steps</>"," * Install the site: https://www.drupal.org/docs/installing-drupal"," * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html"," * Get support: https://www.drupal.org/support"," * Get involved with the Drupal community:"," https://www.drupal.org/getting-involved"," * Remove the plugin that prints this message:"," composer remove drupal/core-project-message"]}},"require-dev": {"drupal/core-dev": "^10.1"}}
内容的提问来源于stack exchange,提问作者Alexandre PEREIRA

