From 3c75fedffe18e86114e3705de87dcb7bd8b47f56 Mon Sep 17 00:00:00 2001 From: Ruben Calvo Date: Sun, 11 Feb 2024 21:20:00 +0100 Subject: [PATCH] [ticket/17289] Fix dependency injection error when using development environment PHPBB3-17289 --- phpBB/phpbb/di/extension/core.php | 8 ++++++-- .../fixtures/config/production/container/environment.yml | 1 + tests/di/fixtures/config/test/container/environment.yml | 1 + .../other_config/production/container/environment.yml | 1 + .../fixtures/other_config/test/container/environment.yml | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php index d6679f1c61..9100150086 100644 --- a/phpBB/phpbb/di/extension/core.php +++ b/phpBB/phpbb/di/extension/core.php @@ -26,7 +26,11 @@ use phpbb\filesystem\helper as filesystem_helper; */ class core extends Extension { - const TWIG_OPTIONS_POSITION = 7; + /** + * Index of array in service template.twig.environment inside services_twig.yml + * @var int + */ + const TWIG_OPTIONS_POSITION = 8; /** * Config path @@ -86,7 +90,7 @@ class core extends Extension $twig_environment_options['auto_reload'] = true; } - // Replace the 7th argument, the options passed to the environment + // Replace the 8th argument, the options passed to the environment $definition->replaceArgument(static::TWIG_OPTIONS_POSITION, $twig_environment_options); if ($config['twig']['enable_debug_extension']) diff --git a/tests/di/fixtures/config/production/container/environment.yml b/tests/di/fixtures/config/production/container/environment.yml index 2792b24162..f71ec2dfd9 100644 --- a/tests/di/fixtures/config/production/container/environment.yml +++ b/tests/di/fixtures/config/production/container/environment.yml @@ -37,4 +37,5 @@ services: - ~ - ~ - ~ + - ~ - [] diff --git a/tests/di/fixtures/config/test/container/environment.yml b/tests/di/fixtures/config/test/container/environment.yml index 356eb4b008..03b394f1fd 100644 --- a/tests/di/fixtures/config/test/container/environment.yml +++ b/tests/di/fixtures/config/test/container/environment.yml @@ -34,4 +34,5 @@ services: - ~ - ~ - ~ + - ~ - [] diff --git a/tests/di/fixtures/other_config/production/container/environment.yml b/tests/di/fixtures/other_config/production/container/environment.yml index aeb552eeb7..dd63c636e1 100644 --- a/tests/di/fixtures/other_config/production/container/environment.yml +++ b/tests/di/fixtures/other_config/production/container/environment.yml @@ -34,4 +34,5 @@ services: - ~ - ~ - ~ + - ~ - [] diff --git a/tests/di/fixtures/other_config/test/container/environment.yml b/tests/di/fixtures/other_config/test/container/environment.yml index b9f6d05018..06366b8160 100644 --- a/tests/di/fixtures/other_config/test/container/environment.yml +++ b/tests/di/fixtures/other_config/test/container/environment.yml @@ -26,4 +26,5 @@ services: - ~ - ~ - ~ + - ~ - []