Development

#9398 (Doctrine Non-Equal Nest Relations Not Working - from "Children" side)

You must first sign up to be able to contribute.

Ticket #9398 (closed defect: worksforme)

Opened 4 years ago

Last modified 3 years ago

Doctrine Non-Equal Nest Relations Not Working - from "Children" side

Reported by: pawelbaranski Assigned to: Jonathan.Wage
Priority: major Milestone:
Component: sfDoctrinePlugin Version: 1.4.x DEV
Keywords: Cc:
Qualification: Unreviewed

Description

I've copy & pasted example from http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/1_0#relationships:join-table-associations:self-referencing-nest-relations:non-equal-nest-relations . I've created User backend module using doctrine:generate-admin backend User task. On how to reproduce the error:

1. Add 3 User objects (A,B,C) 2. Open generated edit form for User A. 3. Set User B as Children from Children list and Save 4. Set User B and C as Chidren from Children list and Save

As a result you will see only C set as Children, and strange situation in database :

UserReference? Table:

parent_id | child_id pk_B | pk_B (!!!) pk_A | pk_C

Environment: Ubuntu 10.04 + PHP 5.3.3 + Symfony 1.4.8

Change History

01/03/11 16:19:58 changed by pawelbaranski

01/06/11 15:39:23 changed by pawelbaranski

New info about error:

try:
0. Add 3 User objects (A,B,C)

CASE 1 - This is not working if you display only parent_list (configured by generator.yml):

1. Open generated edit form for User C.
2. Set User B as Parent from Parent list and Save
3. Open generated edit form for User B.
4. Set User A as Parent from Parent list and Save

Result - saved relation from 2. is removed, only the one from 4. exists

CASE 2 - This is not working if you display only children_list (configured by generator.yml):

1. Open generated edit form for User A.
2. Set User B as Children from Children list and Save
3. Open generated edit form for User B.
4. Set User C as Children from Children list and Save

Result - saved relation from 2. is removed, only the one from 4. exists

CASE 3 - Both lists are in form, but only Children_list works:

Repeat steps from CASE 1 - DOESN'T WORK
Repeat steps from CASE 2 - Works OK

01/26/11 12:40:50 changed by BigBadBassMan

  • owner changed from fabien to Jonathan.Wage.
  • version changed from 1.4.8 to 1.4.x DEV.
  • component changed from model to sfDoctrinePlugin.

related to http://www.doctrine-project.org/jira/browse/DC-329, http://www.doctrine-project.org/jira/browse/DC-958 and #5849, proposed workaround from DC-329 works only partially.

06/07/11 13:19:43 changed by BigBadBassMan

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

use undocumented schema option refClassRelationAlias when defining the self-referencing relation, as proposed by Pavel Campr here: http://www.doctrine-project.org/jira/browse/DC-329