Page 1 of 1

Customization of Relationship

Posted: 19 Jul 2013, 13:05
by mehmet
Hello all friends,

I am currently trying to change the relationship between the bugs. I ll try to explain what I do simply and then post my code and tell you the problem;

Think that we have two bugs; A and B. B is child of A. Whenever a new bug (C) arrived as a child of B, it will detect that B has a parent so that it will direct the relationship to A so finally A will have two children.

What i did was, I changed the relationship_api.php and from the beggining of line 177 I added;

if($c_relationship_type == 2 || $c_relationship_type == '2') // relationship is "child of "
{
$query = "SELECT source_bug_id FROM $t_mantis_bug_relationship_table WHERE destination_bug_id=".db_param() ." AND relationship_type=2";
$result = db_query_bound( $query, $c_src_bug_id);
$t_result = db_fetch_array( $result );
$n_destination = $t_result['source_bug_id'];
if($n_destination != null){
$c_src_bug_id = $n_destination;
}
}

The problem is even when I use this query inside phpmyqdmin, I got the good result but Mantis continues too add wrong values.

Can you please look at my problem and tell me where can be the problem?

Thank you all