View Issue Details

IDProjectCategoryView StatusLast Update
0013124mantisbttime trackingpublic2014-09-23 18:05
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.5 
Target Version1.2.6Fixed in Version1.2.6 
Summary0013124: Getting time tracking info yields application error
Description

After navigating between issues from a filtered list (using the << and >> links at the top of the View Issue Details page), the "Get Time Tracking Information" button returns an error

APPLICATION ERROR #200
A required parameter to this page (bug_id) was not found.

Steps To Reproduce
  • Enable time tracking
  • In View issues, make sure there are multiple records listed
  • Click on the first issue in the list
  • Display time tracking information ==> OK, no error
  • Click on >>
  • Display time tracking information ==> ERROR IS DISPLAYED
Additional Information

The error does not occur when the bug is accessed directly by a link (e.g. from the "Recently Visited" list or the "View Issues" page.

Tagspatch
Attached Files
Fix-13124-for-1.3.x.patch (1,200 bytes)   
From 7dc84cd115c39e56ff8d08174c71b2a65af59314 Mon Sep 17 00:00:00 2001
From: Damien Regad <damien.regad@merckgroup.com>
Date: Mon, 11 Jul 2011 11:08:51 +0200
Subject: [PATCH] Fix #13124: Getting time tracking info yields application error

Replace occurences of bug_view_page.php by view.php
---
 bug_view_inc.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bug_view_inc.php b/bug_view_inc.php
index 570b4be..6c066ae 100644
--- a/bug_view_inc.php
+++ b/bug_view_inc.php
@@ -286,11 +286,11 @@ if ( $t_bugslist ) {
 	$t_index = array_search( $f_bug_id, $t_bugslist );
 	if ( false !== $t_index ) {
 		if ( isset( $t_bugslist[$t_index-1] ) ) {
-			print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index-1], '&lt;&lt;', false, 'previous-bug' );
+			print_bracket_link( 'view.php?bug_id='.$t_bugslist[$t_index-1], '&lt;&lt;', false, 'previous-bug' );
 		}
 
 		if ( isset( $t_bugslist[$t_index+1] ) ) {
-			print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1], '&gt;&gt;', false, 'next-bug' );
+			print_bracket_link( 'view.php?bug_id='.$t_bugslist[$t_index+1], '&gt;&gt;', false, 'next-bug' );
 		}
 	}
 	echo '</span></td>';
-- 
1.7.4.1

Fix-13124-for-1.3.x.patch (1,200 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

dregad

dregad

2011-07-06 11:00

developer   ~0029114

I have narrowed the problem down to the form in the bugnotestats section in bugnote_stats_inc.php.

The post action for this is "form_action_self" which, depending on the circumstances, can be either view.php (direct link to bug) or bug_view_page.php (navigation). The form has a hidden input parameter called "id" which is set to the current bug's id.

  • view.php expects an "id" parameter, so everything works fine when this page displays the bug.
  • bug_view_page.php on the other hand, expects a parameter "bug_id", which is then copied into "id" before including view.php.

So I guess that a quick and dirty workaround for this issue could be implemented as one of the options below:

a) define both parameters (id and bug_id) for the form in bugnote_stats_inc.php
b) only call gpc_get_int( 'bug_id' ) in bug_view_page.php, if the parameter actually exists; this assumes that "id" is defined and defers error handling to view.php
c) apply the same logic in view.php as in bug_view_page.php, i.e. if id is not defined then use bug_id
d) modify the form's action to always use either view.php (or bug_view_page.php) - this would obviously change the URL, not sure if there are any consequences to that but if not it's probably the best option

However, before making any changes, I would like to understand why we have two php scripts doing seemingly the same thing but using different parameters, and why one is used vs the other under some circumstances.

Assuming both scripts indeed serve the same purpose and there is no particular reason for having both of them except legacy, and considering that bug_view_page.php is only referenced 4 times in the code (comments excluded), it seems to me that the best way to go would be to get rid of it in favor of view.php.

dregad

dregad

2011-07-11 05:26

developer   ~0029139

As discussed on mailing list, patch limited to the fix is attached for 1.2.x and 1.3.x.

With regards to removing all references to bug_view_page.php, I left things as they are for now, based on feedback from dhx:

The string_get_bug_page(...) function seems to be unused [...] For 1.2.x I would say it is best to leave it as-is in case a plugin relies upon it. For 1.3.x, the function can be removed entirely as well as the functions that depends on it.

For the switch statement in set_project.php [...] For 1.3.x I think it needs to be mostly rewritten.

I will leave implementation of these changes in 1.3.x to someone having more experienced than I.

dhx

dhx

2011-07-12 04:33

reporter   ~0029140

Thanks Damien, patch applied.

dregad

dregad

2011-07-13 11:32

developer   ~0029160

The patch for 1.3.x I provided was incorrect, as it was not updating the parameter to view.php from bug_id to id. That patch was also wrongly applied to 1.2.x.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036427

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master-1.2.x c3b2321e

2011-07-08 05:04

Damien Regad


Details Diff
Fix 0013124: Getting time tracking info yields application error

Replace occurences of bug_view_page.php by view.php
Affected Issues
0013124
mod - bug_view_inc.php Diff File

MantisBT: master 95b9991d

2011-07-11 05:08

Damien Regad

Committer: dhx


Details Diff
Fix 0013124: Getting time tracking info yields application error

Replace occurences of bug_view_page.php by view.php

Signed-off-by: David Hicks <d@hx.id.au>
Affected Issues
0013124
mod - bug_view_inc.php Diff File

MantisBT: master-1.2.x d1d05b91

2011-07-11 05:08

Damien Regad

Committer: dhx


Details Diff
Fix 0013124: Getting time tracking info yields application error

Replace occurences of bug_view_page.php by view.php

Signed-off-by: David Hicks <d@hx.id.au>
Affected Issues
0013124
mod - bug_view_inc.php Diff File

MantisBT: master-1.2.x 43e1a19d

2011-07-13 03:12

Damien Regad


Details Diff
Revert "Fix 0013124: Getting time tracking info yields application error"

This reverts commit d1d05b91dfecbf0b04d5bc373628aac0b6199d72.
Affected Issues
0013124
mod - bug_view_inc.php Diff File

MantisBT: master 799cbc9c

2011-07-13 03:16

Damien Regad


Details Diff
Revert "Fix 0013124: Getting time tracking info yields application error"

This reverts commit 95b9991dd5496b408f1fa68da5ee22f85a1b1664.
Affected Issues
0013124
mod - bug_view_inc.php Diff File

MantisBT: master f713210f

2011-07-13 03:20

Damien Regad


Details Diff
Fix 0013124: Getting time tracking info yields application error

Replace occurences of bug_view_page.php by view.php
Affected Issues
0013124
mod - bug_view_inc.php Diff File