Repository navigation
#166 - Fail at compile time when Doctrine ORM 2 is used without lazy ghost objects - #167
Merged
Merged
Conversation
…ghost objects
The entities have readonly properties (since v3.2), which the legacy proxies
of Doctrine ORM 2 cannot handle ("Cannot unset readonly property ... from
scope Proxies\__CG__\..." when an entity proxy is loaded).
- New internal CheckDoctrineLazyGhostObjectsPass: with ORM 2, the container
compilation fails with an explicit message when
doctrine.orm.enable_lazy_ghost_objects is not true. Nothing changes with
ORM 3 (always lazy ghost or native lazy objects).
- Documentation: requirement in the database setup, troubleshooting entry.
- Tests: the pass, its registration by the bundle; the kernel tests declare
it as used.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #166 (option 1: keep the Doctrine ORM 2 support). The entities have readonly properties since v3.2 (
ProcessExecution::$code,$startDate,$logFilename,LogRecord::$channel…), which the legacy proxies of Doctrine ORM 2 cannot handle: loading an entity proxy fails withCannot unset readonly property ... from scope Proxies\__CG__\....Changes
New internal
CheckDoctrineLazyGhostObjectsPass(registered byCleverAgeUiProcessBundle::build()): with ORM 2 (detected as the DoctrineBundle does,ProxyFactory::resetUninitializedProxy()), the container compilation fails when thedoctrine.orm.enable_lazy_ghost_objectsparameter (DoctrineBundle 2) is not true:Nothing is checked with ORM 3 (always lazy ghost or native lazy objects), nor without the DoctrineBundle parameter.
Docs: the database setup (
docs/index.md) documentsenable_lazy_ghost_objects: truefor ORM 2; new troubleshooting entry for the PHP error.Tests:
CheckDoctrineLazyGhostObjectsPassTest(failure on ORM 2 without lazy ghost objects, valid configurations, default detection of the installed ORM), the registration of the pass by the bundle; the tests booting the kernel declare the pass as used (#[UsesClass], else risky under coverage). The test kernel comment refers to the pass (it already enables the lazy ghost objects on ORM 2 since Use the PHP 8.3 to 8.5 functions through the Symfony polyfills, and configure Rector accordingly #164).CHANGELOG (Latest).
Checks
masterminds/html5, as onmain).Requirements
Breaking changes
None for working setups. An application on Doctrine ORM 2 without lazy ghost objects (already failing when an entity proxy of the bundle is loaded) now fails at compile time with the message above, and must set
doctrine.orm.enable_lazy_ghost_objects: true.🤖 Generated with Claude Code