Details
-
Type:
Bug
-
Status:
Reopened
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.2.0
-
Fix Version/s: None
-
Component/s: Relations
-
Labels:None
-
Environment:Windows XP, Apache 2.2, PHP 5, Doctrine 1.2 on Symfony 1.4
Description
Object1->Unlink(Relation, Id2) doesn't work, if primary key order in table of m2m reference isnt 1:Object 2: Id to unlink, when relation set to EQUAL= TRUE
User:
actAs:
Timestampable: ~
columns:
name: { type: string(255), notnull: false }
last_name: { type: string(255), notnull: false }
picture: { type: string(255), notnull: false }
birthday: { type: timestamp, notnull: false }
gender: { type: string(255) }
rating: { type: integer, default:0}
num_comments: { type: integer, default:0}
num_groups: { type: integer, default:0}
inheritance:
extends: Member
type: column_aggregation
keyField: type
keyValue: 1
relations:
Friends: { onDelete: CASCADE, class: User, foreignAlias: Friends, refClass: FriendReference, local: user1, foreign: user2, equal: true }
Request: { onDelete: CASCADE, class: User, foreignAlias: Pending, refClass: PendingReference, local: user1, foreign: user2 }
Blocker: { onDelete: CASCADE, class: User, foreignAlias: Blocked, refClass: BlockedReference, local: user1, foreign: user2 }
if(isset($refToRemove)) { switch ($refToRemove) { case 'FriendReference': $references = $currentUser->Friends; $relation = 'Friends'; break; case 'PendingReference': $references = $currentUser->Pending; $relation = 'Pending'; break; case 'BlockerReference': $references = $currentUser->Blocker; $relation = 'Blocker'; break; case 'RequestReference': $references = $currentUser->Request; $relation = 'Request'; break; } foreach($references as $reference) { if ($reference->id == $user2->id) $currentUser->unlink($relation, array($user2->id), $now = true); } }
when you count relations from one side and the other it show that when set to EQUAL = TRUE relations are reciprocal, but unlink still minds primary keys order in order to function
Activity
Roman S. Borschel
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Roman S. Borschel [ romanb ] | Jonathan H. Wage [ jwage ] |
Jonathan H. Wage
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Cannot Reproduce [ 5 ] |
Jonathan H. Wage
made changes -
| Resolution | Cannot Reproduce [ 5 ] | |
| Status | Resolved [ 5 ] | Reopened [ 4 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-560, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
I am unable to reproduce the issue. When I test everything works as expected. We really need some more information and a test case in order to be sure of any issue.