Skip to content

Add ValueResolverInterface check for EntityValueResolver - #2254

Merged
ostrolucky merged 4 commits into
doctrine:3.3.xfrom
alexander-schranz:patch-1
Jul 11, 2026
Merged

Add ValueResolverInterface check for EntityValueResolver#2254
ostrolucky merged 4 commits into
doctrine:3.3.xfrom
alexander-schranz:patch-1

Conversation

@alexander-schranz

@alexander-schranz alexander-schranz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

If somebody has just a requirement to doctrine-bundle but its application is still on Symfony 7.4 or 8.0 it can still happening that it install 8.1 bridge and ends in an error like:

PHP Fatal error:  Uncaught Error: Interface "Symfony\Component\Console\ArgumentResolver\ValueResolver\ValueResolverInterface" not found in /home/runner/work/sulu/sulu/vendor/symfony/doctrine-bridge/ArgumentResolver/Console/EntityValueResolver.php:35
Stack trace:
#0 /home/runner/work/sulu/sulu/vendor/composer/ClassLoader.php(576): include()
#1 /home/runner/work/sulu/sulu/vendor/composer/ClassLoader.php(427): {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}()
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#3 /home/runner/work/sulu/sulu/vendor/doctrine/doctrine-bundle/src/DependencyInjection/DoctrineExtension.php(817): class_exists()
#4 /home/runner/work/sulu/sulu/vendor/doctrine/doctrine-bundle/src/DependencyInjection/DoctrineExtension.php(455): Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension->ormLoad()
#5 /home/runner/work/sulu/sulu/vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php(81): Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension->load()
#6 /home/runner/work/sulu/sulu/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php(40): Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process()
#7 /home/runner/work/sulu/sulu/vendor/symfony/dependency-injection/Compiler/Compiler.php(73): Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process()
#8 /home/runner/work/sulu/sulu/vendor/symfony/dependency-injection/ContainerBuilder.php(825): Symfony\Component\DependencyInjection\Compiler\Compiler->compile()
#9 /home/runner/work/sulu/sulu/vendor/symfony/http-kernel/Kernel.php(516): Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#10 /home/runner/work/sulu/sulu/vendor/symfony/http-kernel/Kernel.php(762): Symfony\Component\HttpKernel\Kernel->initializeContainer()
#11 /home/runner/work/sulu/sulu/vendor/symfony/http-kernel/Kernel.php(122): Symfony\Component\HttpKernel\Kernel->preBoot()
#12 /home/runner/work/sulu/sulu/vendor/symfony/framework-bundle/Console/Application.php(196): Symfony\Component\HttpKernel\Kernel->boot()
#13 /home/runner/work/sulu/sulu/vendor/symfony/framework-bundle/Console/Application.php(70): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()
#14 /home/runner/work/sulu/sulu/vendor/symfony/console/Application.php(195): Symfony\Bundle\FrameworkBundle\Console\Application->doRun()
#15 /home/runner/work/sulu/sulu/packages/article/tests/Application/bin/console.php(49): Symfony\Component\Console\Application->run()
#16 /home/runner/work/sulu/sulu/packages/article/tests/Application/bin/adminconsole(5): include('...')
#17 {main}

To avoid this it need check for both the class and its interface, which comes from different packages which may not be installed in the version expected.

Related to: #2193

@ostrolucky
ostrolucky merged commit 2fdd0d6 into doctrine:3.3.x Jul 11, 2026
13 checks passed
@alexander-schranz
alexander-schranz deleted the patch-1 branch July 13, 2026 14:04
derrabus added a commit to derrabus/DoctrineBundle that referenced this pull request Jul 22, 2026
* 3.3.x: (48 commits)
  Fix dark theme time bar colors in the profiler
  Add ValueResolverInterface check for EntityValueResolver (doctrine#2254)
  Display whether a query ran on a primary or replica in the profiler
  Add missing dependency
  Wire the Console EntityValueResolver as a service
  Fix doctrine:database:create failing without server_version for some connections
  Fix doctrine:database:create failing without server_version for some connections
  Add functional regression test for EntityValueResolver on primary-key routes (doctrine#2230)
  Bump actions/checkout from 6 to 7
  Bump the doctrine group with 6 updates
  Add missing dependency
  Apply latest coding standards
  Downgrade event-dispatcher
  Avoid reporting error from unrelated call
  Bump codecov/codecov-action from 6 to 7
  Add SECURITY.md to link to reporting policy and email.
  Fix coding standard: use aliased class name in RequiresMethod attribute
  Remove empty registerCommands override
  remove form related services if the Form component is not installed
  Remove mention of lazy entity listeners
  ...
derrabus added a commit to derrabus/DoctrineBundle that referenced this pull request Jul 22, 2026
* 3.3.x: (49 commits)
  Revert EventDispatcher downgrade (doctrine#2256)
  Fix dark theme time bar colors in the profiler
  Add ValueResolverInterface check for EntityValueResolver (doctrine#2254)
  Display whether a query ran on a primary or replica in the profiler
  Add missing dependency
  Wire the Console EntityValueResolver as a service
  Fix doctrine:database:create failing without server_version for some connections
  Fix doctrine:database:create failing without server_version for some connections
  Add functional regression test for EntityValueResolver on primary-key routes (doctrine#2230)
  Bump actions/checkout from 6 to 7
  Bump the doctrine group with 6 updates
  Add missing dependency
  Apply latest coding standards
  Downgrade event-dispatcher
  Avoid reporting error from unrelated call
  Bump codecov/codecov-action from 6 to 7
  Add SECURITY.md to link to reporting policy and email.
  Fix coding standard: use aliased class name in RequiresMethod attribute
  Remove empty registerCommands override
  remove form related services if the Form component is not installed
  ...
derrabus added a commit to derrabus/DoctrineBundle that referenced this pull request Jul 22, 2026
* 3.3.x: (49 commits)
  Revert EventDispatcher downgrade (doctrine#2256)
  Fix dark theme time bar colors in the profiler
  Add ValueResolverInterface check for EntityValueResolver (doctrine#2254)
  Display whether a query ran on a primary or replica in the profiler
  Add missing dependency
  Wire the Console EntityValueResolver as a service
  Fix doctrine:database:create failing without server_version for some connections
  Fix doctrine:database:create failing without server_version for some connections
  Add functional regression test for EntityValueResolver on primary-key routes (doctrine#2230)
  Bump actions/checkout from 6 to 7
  Bump the doctrine group with 6 updates
  Add missing dependency
  Apply latest coding standards
  Downgrade event-dispatcher
  Avoid reporting error from unrelated call
  Bump codecov/codecov-action from 6 to 7
  Add SECURITY.md to link to reporting policy and email.
  Fix coding standard: use aliased class name in RequiresMethod attribute
  Remove empty registerCommands override
  remove form related services if the Form component is not installed
  ...
derrabus added a commit to derrabus/DoctrineBundle that referenced this pull request Jul 22, 2026
* 3.3.x: (49 commits)
  Revert EventDispatcher downgrade (doctrine#2256)
  Fix dark theme time bar colors in the profiler
  Add ValueResolverInterface check for EntityValueResolver (doctrine#2254)
  Display whether a query ran on a primary or replica in the profiler
  Add missing dependency
  Wire the Console EntityValueResolver as a service
  Fix doctrine:database:create failing without server_version for some connections
  Fix doctrine:database:create failing without server_version for some connections
  Add functional regression test for EntityValueResolver on primary-key routes (doctrine#2230)
  Bump actions/checkout from 6 to 7
  Bump the doctrine group with 6 updates
  Add missing dependency
  Apply latest coding standards
  Downgrade event-dispatcher
  Avoid reporting error from unrelated call
  Bump codecov/codecov-action from 6 to 7
  Add SECURITY.md to link to reporting policy and email.
  Fix coding standard: use aliased class name in RequiresMethod attribute
  Remove empty registerCommands override
  remove form related services if the Form component is not installed
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants