[PR #981] [CLOSED] Throw exception for invalid mappedBys rather than PHP undefined index warning #8992

Open
opened 2026-01-22 16:02:40 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/981
Author: @rodmcnew
Created: 3/17/2014
Status: Closed

Base: masterHead: throw-exception-for-invalid-mappedBy


📝 Commits (1)

  • 01227b9 This fix throws an appropriate MappingException with an explanation of what is wrong with the mapping rather than just throwing an un-actionable php warning.

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 lib/Doctrine/ORM/Persisters/BasicEntityPersister.php (+8 -0)

📄 Description

This fix throws an appropriate MappingException with an explanation of what is wrong with the mapping rather than just throwing an un-actionable php warning.

Example old error message: "Undefined index: item in /www/apps/rwriter/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php on line 2079”

Example new MappingException message: “Property items in RcmShoppingCart\Entity\TempOrder specified mappedBy="tempOrderItem" but tempOrderItem is not a property of RcmShoppingCart\Entity\TempOrderItem”


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/981 **Author:** [@rodmcnew](https://github.com/rodmcnew) **Created:** 3/17/2014 **Status:** ❌ Closed **Base:** `master` ← **Head:** `throw-exception-for-invalid-mappedBy` --- ### 📝 Commits (1) - [`01227b9`](https://github.com/doctrine/orm/commit/01227b9e6a65503dd9f1766b91f717ba15ef0811) This fix throws an appropriate MappingException with an explanation of what is wrong with the mapping rather than just throwing an un-actionable php warning. ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Persisters/BasicEntityPersister.php` (+8 -0) </details> ### 📄 Description This fix throws an appropriate MappingException with an explanation of what is wrong with the mapping rather than just throwing an un-actionable php warning. Example old error message: "Undefined index: item in /www/apps/rwriter/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php on line 2079” Example new MappingException message: “Property items in RcmShoppingCart\Entity\TempOrder specified mappedBy="tempOrderItem" but tempOrderItem is not a property of RcmShoppingCart\Entity\TempOrderItem” --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:02:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#8992