Fix Doctrine ORM 3 errors by updating the Assessment–Project OneToOne #137
+4
−2
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.
Fix Doctrine ORM 3.x inverse-side DQL errors + correct One-to-One mapping
This PR updates all Assessment ↔ Project queries to be compatible with Doctrine ORM 3.x, which enforces stricter rules for association usage.
What was happening
After upgrading to Doctrine ORM 3, multiple queries began failing with:
This occurred because Assessment::$project is the inverse side of a One-To-One relationship, and Doctrine 3 forbids DQL path expressions on inverse associations.
What this PR changes
• Correctly defines the owning side (Project::$assessment) with an explicit JoinColumn
• Rewrites all DQL queries to join via the owning side:
• Replaced assessment.project joins with project.assessment
• Updated WHERE clauses accordingly
• Removes legacy inverse-side traversal that was silently allowed in ORM 2.x but invalid in ORM 3.x
Why this is needed
Doctrine ORM 3 removed several implicit behaviors and now requires association paths to reference the owning side.
These fixes:
• Prevent runtime template errors during rendering
• Ensure future queries function consistently
• Bring our mapping and DQL usage in line with Doctrine 3’s stricter requirements
• Makes the entity relationship definition explicit and correct
Testing
• All updated queries were tested manually against existing data
• Confirmed that lazy-loading works normally through the owning side
Result
The codebase is now fully compatible with Doctrine ORM 3.x and avoids all inverse-side DQL issues.