View Issue Details

IDProjectCategoryView StatusLast Update
0004725mantisbtbugtrackerpublic2004-11-06 06:01
Reporterjferraz Assigned Tothraxisp  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Versiongit trunk 
Fixed in Version0.19.1 
Summary0004725: (0001466) Broken HTML / Misaligned links on top of view pages
Description

The fix for 0001466 caused the bug_view_page.php and bug_view_advanced_page.php to generate broken HTML code. When we have a bug list, the generated page contains (the title of the table):

&lt!-- Title -->
<td class="form-title" colspan="3">
...
<!-- prev/next links -->
<td class="center">
(i.e. a td tag nested into another td tag).

When we don't have a bug list, the links section appears misaligned, since the table contains 6 columns, the title has colspan=3 and links has colspan=2 (one spare column is missed).

Additional Information

Refer to cvs diffs:

  • bug_view_page.php 1.66 -> 1.67
  • bug_view_advanced_page.php 1.62 -> 1.63

Please, someone with proper privileges link this bug to 0001466. Perhaps it should also be child of 0004297 (it is up to you).

TagsNo tags attached.
Attached Files
4725.patch (6,050 bytes)   
Index: bug_view_advanced_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_view_advanced_page.php,v
retrieving revision 1.65
diff -U4 -p -r1.65 bug_view_advanced_page.php
--- bug_view_advanced_page.php	16 Oct 2004 15:32:26 -0000	1.65
+++ bug_view_advanced_page.php	16 Oct 2004 17:16:28 -0000
@@ -39,8 +39,10 @@
 	html_page_top2();
 
 	$t_access_level_needed = config_get( 'view_history_threshold' );
 	$t_can_view_history = access_has_bug_level( $t_access_level_needed, $f_bug_id );
+
+	$t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );
 ?>
 
 <br />
 <table class="width100" cellspacing="1">
@@ -48,9 +50,9 @@
 
 <tr>
 
 	<!-- Title -->
-	<td class="form-title" colspan="3">
+	<td class="form-title" colspan="<?php echo $t_bugslist ? '3' : '4' ?>">
 		<?php echo lang_get( 'viewing_bug_advanced_details_title' ) ?>
 
 		<!-- Jump to Bugnotes -->
 		<span class="small"><?php print_bracket_link( "#bugnotes", lang_get( 'jump_to_bugnotes' ) ) ?></span>
@@ -66,22 +68,22 @@
 	<?php
 		}
 	?>
 	</td>
-		<!-- prev/next links -->
-		<?php if( $t_bugslist = gpc_get_cookie( 'bugslist', false ) ) { ?>
-		<td class="center"><span class="small"> 			
-			<?php 
-				$t_bugslist = explode( ',', $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], '<<' ); 
-					if( isset( $t_bugslist[$t_index+1] ) ) print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1], '>>' ); 
-				}
-			?>
-		</span></td>
-		<?php } ?>
-	</td>
+
+	<!-- prev/next links -->
+	<?php if( $t_bugslist ) { ?>
+	<td class="center"><span class="small">
+		<?php 
+			$t_bugslist = explode( ',', $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_advanced_page.php?bug_id='.$t_bugslist[$t_index-1], '&lt;&lt;' ); 
+				if( isset( $t_bugslist[$t_index+1] ) ) print_bracket_link( 'bug_view_advanced_page.php?bug_id='.$t_bugslist[$t_index+1], '&gt;&gt;' ); 
+			}
+		?>
+	</span></td>
+	<?php } ?>
 
 	<!-- Links -->
 	<td class="right" colspan="2">
 
Index: bug_view_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_view_page.php,v
retrieving revision 1.69
diff -U4 -p -r1.69 bug_view_page.php
--- bug_view_page.php	16 Oct 2004 15:32:26 -0000	1.69
+++ bug_view_page.php	16 Oct 2004 17:16:28 -0000
@@ -37,8 +37,10 @@
 	$t_access_level_needed = config_get( 'view_history_threshold' );
 	$t_can_view_history = access_has_bug_level( $t_access_level_needed, $f_bug_id );
 
 	compress_enable();
+
+	$t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );
 ?>
 <?php html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ) ?>
 <?php html_page_top2() ?>
 
@@ -48,9 +50,9 @@
 
 <tr>
 
 	<!-- Title -->
-	<td class="form-title" colspan="3">
+	<td class="form-title" colspan="<?php echo $t_bugslist ? '3' : '4' ?>">
 		<?php echo lang_get( 'viewing_bug_simple_details_title' ) ?>
 
 		<!-- Jump to Bugnotes -->
 		<span class="small"><?php print_bracket_link( "#bugnotes", lang_get( 'jump_to_bugnotes' ) ) ?></span>
@@ -66,22 +68,22 @@
 	<?php
 		}
 	?>
 	</td>
-		<!-- prev/next links -->
-		<?php if( $t_bugslist = gpc_get_cookie( 'bugslist', false ) ) { ?>
-		<td class="center"><span class="small"> 			
-			<?php 
-				$t_bugslist = explode( ',', $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], '<<' ); 
-					if( isset( $t_bugslist[$t_index+1] ) ) print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1], '>>' ); 
-				}
-			?>
-		</span></td>
-		<?php } ?>
-	</td>
+
+	<!-- prev/next links -->
+	<?php if( $t_bugslist ) { ?>
+	<td class="center"><span class="small"> 			
+		<?php 
+			$t_bugslist = explode( ',', $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;' ); 
+				if( isset( $t_bugslist[$t_index+1] ) ) print_bracket_link( 'bug_view_page.php?bug_id='.$t_bugslist[$t_index+1], '&gt;&gt;' ); 
+			}
+		?>
+	</span></td>
+	<?php } ?>
 
 	<!-- Links -->
 	<td class="right" colspan="2">
 
Index: config_defaults_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v
retrieving revision 1.218
diff -U4 -p -r1.218 config_defaults_inc.php
--- config_defaults_inc.php	13 Oct 2004 12:20:35 -0000	1.218
+++ config_defaults_inc.php	16 Oct 2004 17:16:29 -0000
@@ -1087,8 +1087,9 @@
 	$g_project_cookie		= $g_cookie_prefix.'_PROJECT_COOKIE';
 	$g_view_all_cookie		= $g_cookie_prefix.'_VIEW_ALL_COOKIE';
 	$g_manage_cookie		= $g_cookie_prefix.'_MANAGE_COOKIE';
 	$g_logout_cookie		= $g_cookie_prefix.'_LOGOUT_COOKIE';
+	$g_bug_list_cookie		= $g_cookie_prefix.'_BUG_LIST_COOKIE';
 
 	#######################################
 	# Mantis Filter Variables
 	#######################################
Index: view_all_bug_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/view_all_bug_page.php,v
retrieving revision 1.55
diff -U4 -p -r1.55 view_all_bug_page.php
--- view_all_bug_page.php	25 Sep 2004 13:34:25 -0000	1.55
+++ view_all_bug_page.php	16 Oct 2004 17:16:29 -0000
@@ -38,9 +38,9 @@
 	for($i=0; $i < sizeof( $rows ); $i++) {
 		array_push($t_bugslist, $rows[$i]["id"] );
 	}
 
-	gpc_set_cookie( 'bugslist', implode( ',', $t_bugslist ) );
+	gpc_set_cookie( config_get( 'bug_list_cookie' ), implode( ',', $t_bugslist ) );
 
 	compress_enable();
 
 	html_page_top1( lang_get( 'view_bugs_link' ) );
4725.patch (6,050 bytes)   

Activities

thraxisp

thraxisp

2004-10-16 10:29

reporter   ~0008072

Fixed in CVS.

There was a missing (/td) tag.

jferraz

jferraz

2004-10-16 11:46

reporter   ~0008073

Now we have two consecutive (/td) tags, and still have misaligned cell when there is no bug list...

jferraz

jferraz

2004-10-16 12:08

reporter   ~0008074

Even more bugs found:

  • at least the "<<" link sould be escaped (<<) to avoid conflict with HTML tags;
  • links on bug_view_advanced_page.html leads you to bug_view_page.html;
  • "bugslist" cookie (I think it should be something like MANTIS_BUG_LIST_COOKIE).
jferraz

jferraz

2004-10-16 12:22

reporter   ~0008075

Attached suggested patch (4725.patch). Bugs fixed:

  • removed spare /td tag left by the previous fix of this issue;
  • '<<' converted to '<<', '>>' to '>>';
  • links on advanced page sends you back to the the advanced page of the linked bug;
  • "bugslist" cookie changed to "MANTIS_BUG_LIST_COOKIE", with proper config_defaults_inc.php variable;
  • fixed alignment of links when no buglist is present (title cell spans four columns in this case);
  • fixed check for array_search, which caused no links to appear when you visit the first bug of the list ( != should be !== ).

Hope these were the only bugs caused by 0001466... Someone wasn't on his best day... :-P

thraxisp

thraxisp

2004-10-16 19:12

reporter   ~0008076

patch submitted to CVS.