- Issue created by @Project Update Bot
This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 11 Compatibility
According to the Upgrade Status module → , even with these changes, this module is not yet compatible with Drupal 11.
Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.
Therefore these changes did not update the
info.yml
file for Drupal 11 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot → to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug information
Bot run #11-127659These packages were used to generate the fixes:
- drupal/upgrade_status: 4.1.0
- mglaman/phpstan-drupal: 1.2.9
- palantirnet/drupal-rector: 0.20.1
- 🇦🇺Australia VladimirAus Brisbane, Australia
vladimiraus → changed the visibility of the branch 3435378-automated-drupal-11 to hidden.
- Status changed to Needs work
2 months ago 11:42pm 9 September 2024 - 🇺🇸United States keiserjb
I encountered a couple of other problems. In order to make it work I had to remove the ContainerInjectionInterface from DynamicPathProcessor.php.
I also needed to remove
calls:
- [setContainer, ['@service_container']]from view_mode_page.services.yml
- First commit to issue fork.
- 🇫🇷France dydave
Thanks Justin (@keiserjb) for your help on this.
I've tested the issue fork and encountered probably the same error as you:
PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Drupal\view_mode_page\PathProcessor\DynamicPathProcessor does not have a method "setContainer" in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:276
Full error with stacktrace:
$ drush cr PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Drupal\view_mode_page\PathProcessor\DynamicPathProcessor does not have a method "setContainer" in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:276 Stack trace: #0 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(276): call_user_func_array() #1 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #2 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #3 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #4 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #5 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #6 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #7 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #8 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #9 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #10 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(445): Drupal\Component\DependencyInjection\Container->createService() #11 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #12 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #13 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #14 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #15 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #16 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #17 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #18 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #19 /var/www/html/web/core/lib/Drupal.php(197): Drupal\Component\DependencyInjection\Container->get() #20 /var/www/html/web/core/includes/common.inc(423): Drupal::service() #21 /var/www/html/web/core/includes/utility.inc(41): drupal_flush_all_caches() #22 /var/www/html/vendor/drush/drush/src/Commands/core/CacheRebuildCommands.php(60): drupal_rebuild() #23 [internal function]: Drush\Commands\core\CacheRebuildCommands->rebuild() #24 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array() #25 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() #26 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() #27 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process() #28 /var/www/html/vendor/symfony/console/Command/Command.php(279): Consolidation\AnnotatedCommand\AnnotatedCommand->execute() #29 /var/www/html/vendor/symfony/console/Application.php(1047): Symfony\Component\Console\Command\Command->run() #30 /var/www/html/vendor/symfony/console/Application.php(316): Symfony\Component\Console\Application->doRunCommand() #31 /var/www/html/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun() #32 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run() #33 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun() #34 /var/www/html/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run() #35 /var/www/html/vendor/bin/drush.php(119): include('...') #36 {main} thrown in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 276 Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Drupal\view_mode_page\PathProcessor\DynamicPathProcessor does not have a method "setContainer" in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:276 Stack trace: #0 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(276): call_user_func_array() #1 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #2 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #3 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #4 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #5 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #6 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #7 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #8 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #9 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #10 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(445): Drupal\Component\DependencyInjection\Container->createService() #11 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #12 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #13 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #14 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #15 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #16 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(430): Drupal\Component\DependencyInjection\Container->get() #17 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() #18 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService() #19 /var/www/html/web/core/lib/Drupal.php(197): Drupal\Component\DependencyInjection\Container->get() #20 /var/www/html/web/core/includes/common.inc(423): Drupal::service() #21 /var/www/html/web/core/includes/utility.inc(41): drupal_flush_all_caches() #22 /var/www/html/vendor/drush/drush/src/Commands/core/CacheRebuildCommands.php(60): drupal_rebuild() #23 [internal function]: Drush\Commands\core\CacheRebuildCommands->rebuild() #24 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array() #25 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() #26 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() #27 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process() #28 /var/www/html/vendor/symfony/console/Command/Command.php(279): Consolidation\AnnotatedCommand\AnnotatedCommand->execute() #29 /var/www/html/vendor/symfony/console/Application.php(1047): Symfony\Component\Console\Command\Command->run() #30 /var/www/html/vendor/symfony/console/Application.php(316): Symfony\Component\Console\Application->doRunCommand() #31 /var/www/html/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun() #32 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run() #33 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun() #34 /var/www/html/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run() #35 /var/www/html/vendor/bin/drush.php(119): include('...') #36 {main} thrown in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 276 [warning] Drush command terminated abnormally.
After applying the changes suggested at #6 and re-installing the issue fork, the error disappeared, see commit:
https://git.drupalcode.org/project/view_mode_page/-/merge_requests/8/dif...Moving this back to Needs review.
Thanks in advance!