Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.0
-
Fix Version/s: None
-
Component/s: Relations
-
Labels:None
-
Environment:Mac OSX 10.5, Symfony 1.4 and MAMP
Description
There is a problem when you save Many to Many Self Referencing (Nest Relations).
I used the same example that it's used on Doctrine 1.2 Self Referencing (Nest Relations) Documentation:
My Schema:
User:
columns:
name:Unknown macro: { type}relations:
Parents:
class: User
local: child_id
foreign: parent_id
refClass: UserReference
foreignAlias: ChildrenUserReference:
columns:
parent_id:
type: integer
primary: true
child_id:
type: integer
primary: true
Fixtures:
User:
james:
name: James
alexander:
name: Alexander
david:
name: David
The problem happens with the Children. The first time I assigned children and saved the User, there is no problem; but when I saved the User again (without any change on him) the values in the UserReference? table changes: the "parent_id" takes the value of the "child_id".
I test it with Sf 1.4 and with Sf 1.3 stable versions, and I've got the same error.
If it not clear to understand what I'm saying, I put a "very ilustrative" image about the form and how change the values of the UserReference? table. Please see it, because it would be very usefull for understanding (explains better than my terrible English)
Thanks for all your work!
P. D.
I forgot to to say that watching the stack trace I think that the problem is in:
symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php
In the line 429:
public function saveAssociations(Doctrine_Record $record)
I would like to help more, but I couldn't figure out how this function works.
Activity
| Field | Original Value | New Value |
|---|---|---|
| Attachment | saving process.png [ 10216 ] |
| Description |
There is a problem when you save Many to Many Self Referencing (Nest Relations). I used the same example that it's used on Doctrine 1.2 Self Referencing (Nest Relations) Documentation: My Schema: {quote} User: columns: name: { type: string(255), notnull: true } relations: Parents: class: User local: child_id foreign: parent_id refClass: UserReference foreignAlias: Children UserReference: columns: parent_id: type: integer primary: true child_id: type: integer primary: true {quote} Fixtures: {quote} User: james: name: James alexander: name: Alexander david: name: David {quote} The problem happens with the Children. The first time I assigned children and saved the User, there is no problem; but when I saved the User again (without any change on him) the values in the UserReference? table changes: the "parent_id" takes the value of the "child_id". I test it with Sf 1.4 and with Sf 1.3 stable versions, and I've got the same error. If it not clear to understand what I'm saying, I put a "very ilustrative" image about the form and how change the values of the UserReference? table. Please see it, because it would be very usefull for understanding (explains better than my terrible English) Thanks for all your work! P. D. I forgot to to say that watching the stack trace I think that the problem is in: symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php In the line 429: {quote} public function saveAssociations(Doctrine_Record $record) {quote} I would like to help more, but I couldn't figure out how this function works. |
There is a problem when you save Many to Many Self Referencing (Nest Relations). I used the same example that it's used on Doctrine 1.2 Self Referencing (Nest Relations) Documentation: My Schema: {quote} User: columns: name: { type: string(255), notnull: true } relations: Parents: class: User local: child_id foreign: parent_id refClass: UserReference foreignAlias: Children UserReference: columns: parent_id: type: integer primary: true child_id: type: integer primary: true {quote} Fixtures: {quote} User: james: name: James alexander: name: Alexander david: name: David {quote} The problem happens with the Children. The first time I assigned children and saved the User, there is no problem; but when I saved the User again (without any change on him) the values in the UserReference? table changes: the "parent_id" takes the value of the "child_id". I test it with Sf 1.4 and with Sf 1.3 stable versions, and I've got the same error. If it not clear to understand what I'm saying, I put a "very ilustrative" image about the form and how change the values of the UserReference? table. Please see it, because it would be very usefull for understanding (explains better than my terrible English) Thanks for all your work! P. D. I forgot to to say that watching the stack trace I think that the problem is in: symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php In the line 429: {quote} public function saveAssociations(Doctrine_Record $record) {quote} I would like to help more, but I couldn't figure out how this function works. |
| Fix Version/s | 1.2.2 [ 10047 ] | |
| Fix Version/s | 1.2.1 [ 10044 ] |
| Assignee | Roman S. Borschel [ romanb ] | Jonathan H. Wage [ jwage ] |
| Attachment | schema.yml [ 10260 ] | |
| Attachment | testEqualNestRelationsTest.php [ 10261 ] | |
| Attachment | testNestedEqualRelationWithObjectsTest.php [ 10262 ] |
| Fix Version/s | 1.2.3 [ 10051 ] | |
| Fix Version/s | 1.2.2 [ 10047 ] |
| Attachment | h2aEqualable.zip [ 10505 ] |
| Fix Version/s | 1.2.3 [ 10051 ] |