View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012471 | mantisbt | reports | public | 2010-10-22 04:57 | 2010-12-17 04:40 |
Reporter | jmonin | Assigned To | dhx | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.3 | ||||
Target Version | 1.2.4 | Fixed in Version | 1.2.4 | ||
Summary | 0012471: Relationships graph doesn't cope well with custom bug id formats | ||||
Description | When creating the digraph command for the graphviz API, Mantis uses the bug id as the name, but in its display format. When this display format contains invalid characters (e.g. "-"), the graph fails. | ||||
Tags | patch | ||||
Attached Files | mantis-1.2.3-patch-relationship-graph-id.patch (1,178 bytes)
--- mantisbt-1.2.3-orig/core/relationship_graph_api.php 2010-09-14 20:40:10.000000000 +0200 +++ mantisbt-1.2.3/core/relationship_graph_api.php 2010-10-22 10:45:34.000000000 +0200 @@ -118,7 +118,8 @@ # We have already collected all the information we need to generate # the graph. Now it is the matter to create a Digraph object and # store the information there, along with graph formatting attributes. - $t_id_string = bug_format_id( $p_bug_id ); + # $t_id_string = bug_format_id( $p_bug_id ); + $t_id_string = $p_bug_id; $t_graph_fontname = config_get( 'relationship_graph_fontname' ); $t_graph_fontsize = config_get( 'relationship_graph_fontsize' ); $t_graph_fontpath = get_font_path(); @@ -239,7 +240,7 @@ # We have already collected all the information we need to generate # the graph. Now it is the matter to create a Digraph object and # store the information there, along with graph formatting attributes. - $t_id_string = bug_format_id( $p_bug_id ); + $t_id_string = $p_bug_id; $t_graph_fontname = config_get( 'relationship_graph_fontname' ); $t_graph_fontsize = config_get( 'relationship_graph_fontsize' ); $t_graph_fontpath = get_font_path(); | ||||
You'll find attached a general patch for this issue, using the "raw" bug id for the digraph export. It doesn't affect the generated graph, which shows the display id's. |
|
Thanks Jimmy, I've committed a patch that should resolve this issue. I didn't use your patch directly as we can still show some pretty formatted bug IDs - the ones which adhere to certain DOT language character restrictions on IDs. So if a plugin returns a pretty bug ID of ABC123, it'll show like that in relationship graphs. If a plugin returns the DOT-invalid bug ID of ABC-123 then it'll revert to just showing "123" instead (with no padded zeros either). |
|
MantisBT: master 3683fac4 2010-11-19 10:08 Details Diff |
Fix 0012471: Bug formatted IDs not escaped properly for DOT relgraph Bug IDs can be pretty formatted by plugins handling the EVENT_DISPLAY_BUG_ID event. The returned pretty formatted ID may not be safe to dump directly into the DOT language script used to generate relationship graphs. Therefore we need to check for a valid format according to DOT language rules. If the format returned is invalid then we use the raw bug ID (non-padded) instead. Thanks to Jimmy Monin for reporting this issue and providing assistance. |
Affected Issues 0012471 |
|
mod - core/relationship_graph_api.php | Diff File | ||
MantisBT: master-1.2.x c60ad8d2 2010-11-19 10:08 Details Diff |
Fix 0012471: Bug formatted IDs not escaped properly for DOT relgraph Bug IDs can be pretty formatted by plugins handling the EVENT_DISPLAY_BUG_ID event. The returned pretty formatted ID may not be safe to dump directly into the DOT language script used to generate relationship graphs. Therefore we need to check for a valid format according to DOT language rules. If the format returned is invalid then we use the raw bug ID (non-padded) instead. Thanks to Jimmy Monin for reporting this issue and providing assistance. |
Affected Issues 0012471 |
|
mod - core/relationship_graph_api.php | Diff File |