View Issue Details

IDProjectCategoryView StatusLast Update
0007846mantisbtrelationshipspublic2007-10-04 01:38
Reporteremathieu Assigned Tovboctor  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version1.0.6 
Target Version1.0.9Fixed in Version1.1.0rc1 
Summary0007846: APPLICATION ERROR #1802: Relationship not found
Description

While accessing one particular bug, I get APPLICATION ERROR #1802: Relationship not found. List of relationship is correct.

Additional Information

After some debugging I found that this problem was raised while localizing this relationship changes in history.
In history_localize_item, the call to relationship_get_description_for_history for BUG_ADD_RELATIONSHIP is crashing because parameter value for $p_old_value is -2, which lead to default choice in the switch and so error trigger.
In my bug_history_table there are a few records with type=18 and old_value=-2

TagsNo tags attached.

Relationships

has duplicate 0008262 closedvboctor Relationship not found error 

Activities

Ellerbrok

Ellerbrok

2007-04-25 00:52

reporter   ~0014396

Hi,

those mentioned records with the old_value=-2 have a bug id and a new value that is also a bug id.

What relation should there be between those bug entries? And from what date are these entries?

Regards,
Marcel

emathieu

emathieu

2007-07-24 08:41

reporter   ~0015207

Hi Marcel,

Can you please clarify ?

DGtlRift

DGtlRift

2007-08-03 12:48

reporter   ~0015336

I am seeing this at the bottom of issue 0004181

vboctor

vboctor

2007-08-26 17:20

manager   ~0015536

In core/history_api.php - history_localize_item()

Replace:
case BUG_DEL_RELATIONSHIP:
$t_note = lang_get( 'relationship_deleted' );
$t_change = relationship_get_description_for_history( $p_old_value ) . ' ' . bug_format_id( $p_new_value );
break;

With:
case BUG_DEL_RELATIONSHIP:
$t_note = lang_get( 'relationship_deleted' );

# Fix for #7846: There are some cases where old value is empty, this may be due to an old bug.
if ( !is_blank( $p_old_value ) && $p_old_value > 0 ) {
    $t_change = relationship_get_description_for_history( $p_old_value ) . ' ' . bug_format_id( $p_new_value );
} else {
    $t_change = bug_format_id( $p_new_value );
}
break;