Development

#7690 (Problem saving Self Referencing (Nest Relations))

You must first sign up to be able to contribute.

Ticket #7690 (closed defect: invalid)

Opened 5 years ago

Last modified 4 years ago

Problem saving Self Referencing (Nest Relations)

Reported by: jaimesuez Assigned to: Jonathan.Wage
Priority: major Milestone: 1.3.0
Component: sfDoctrinePlugin Version: 1.4.0 RC2
Keywords: Cc:
Qualification: Unreviewed

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: { 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

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, 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!

Attachments

saving process.png (62.7 kB) - added by jaimesuez on 11/24/09 17:32:09.
Diagram of the problem in the saving process

Change History

11/24/09 17:32:09 changed by jaimesuez

  • attachment saving process.png added.

Diagram of the problem in the saving process

11/24/09 17:38:10 changed by jaimesuez

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 didn't figure out how this function works.

11/24/09 19:10:08 changed by Kris.Wallsmith

  • milestone changed from 1.4.0 to 1.3.0.

11/30/09 23:08:15 changed by Jonathan.Wage

  • status changed from new to closed.
  • resolution set to invalid.

This ticket belongs in Doctrine Jira http://www.doctrine-project.org/jira

06/17/10 17:11:39 changed by virtualize

this is the corresponding doctrine ticket:
http://www.doctrine-project.org/jira/browse/DC-329