Menu

#4722 (ok 4.3.8) Incorrect width table summary when favorite tables is disabled

4.3.7
fixed
None
1
2015-01-24
2015-01-21
No

Bug probably introduced in version 4.3.3 (after applying https://sourceforge.net/p/phpmyadmin/bugs/4647/).

In case favorite tables is disabled (NumFavoriteTables=0), colspan of Sum is 7. In this situation it should be 6.

Code applied in bug 4647: libraries/structure.lib.php - row 506-511

//Favorite table anchor.
if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) {
$html_output .= ''
. PMA_getHtmlForFavoriteAnchor($db, $current_table, $titles)
. '';
}

Code colspan: libraries/structure.lib.php - row 177

# Bug has to be fixed here
# Note: I added a space below (< th) to make entire row visible in bug report)
$html_output .= '< th colspan="' . ($db_is_system_schema ? 4 : 7) . '">'

Suggested fix:

$sum_colspan = ($db_is_system_schema ? 4 : 7);
if ($GLOBALS['cfg']['NumFavoriteTables']==0)
$sum_colspan--;
# Note: I added a space below (< th) to make entire row visible in bug report)
$html_output .= '< th colspan="' . $sum_colspan . '">'

I can only test $db_is_system_schema=false situation, but code shows in situation $db_is_system_schema=true only 3 columns (browse, structure, search) are appended to HTML-output.

Discussion

  • Alexander Kamp

    Alexander Kamp - 2015-01-21

    Addition: In method PMA_tableHeader (same file, row 808-815), it's build up this way:

    if ($db_is_system_schema) {
    $action_colspan = 3;
    } else {
    $action_colspan = 6;
    }
    if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) {
    $action_colspan++;
    }
    Of course the correct colspan can be calculated by adding up one instaid of subtracting one.

     
  • Marc Delisle

    Marc Delisle - 2015-01-21
    • assigned_to: Marc Delisle
     
  • Marc Delisle

    Marc Delisle - 2015-01-21
    • summary: Incorrect width table summary when favorite tables is disabled --> (ok 4.3.8) Incorrect width table summary when favorite tables is disabled
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2015-01-24
    • Status: resolved --> fixed