Skip to content

Commit

Permalink
Fix system notice in installer
Browse files Browse the repository at this point in the history
When the installer is not able to connect to the database as admin, the
DB version check fails because the version cannot be retrieved from the
server. This causes display of a PHP notice. Initializing
$t_version_info fixes this problem.

Additionally, the test result is shown as 'BAD' in this case, which is
not necessarily correct (we just don't know), so we now display
'POSSIBLE PROBLEM' instead.

Fixes #19676
  • Loading branch information
dregad committed Apr 29, 2015
1 parent 394a777 commit 5fea91c
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions admin/install.php
Expand Up @@ -424,6 +424,7 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
$t_version_info = @$g_db->ServerInfo();
} else {
print_test_result( BAD, true, 'Does administrative user have access to the database? ( ' . db_error_msg() . ' )' );
$t_version_info = null;
}
?>
</tr>
Expand Down Expand Up @@ -462,11 +463,14 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
<tr>
<td bgcolor="#ffffff">
Checking Database Server Version
<?php
echo '<br /> Running ' . string_attribute( $f_db_type ) . ' version ' . nl2br( $t_version_info['description'] );
?>
<?php
if( isset( $t_version_info['description'] ) ) {
echo '<br /> Running ' . string_attribute( $f_db_type )
. ' version ' . nl2br( $t_version_info['description'] );
}
?>
</td>
<?php
<?php
$t_warning = '';
$t_error = '';
switch( $f_db_type ) {
Expand All @@ -488,8 +492,16 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
break;
}

print_test_result( ( '' == $t_error ) && ( '' == $t_warning ), ( '' != $t_error ), $t_error . ' ' . $t_warning );
?>
if( is_null( $t_version_info ) ) {
$t_warning = "Unable to determine '$f_db_type' version. ($t_error).";
$t_error = '';
}
print_test_result(
( '' == $t_error ) && ( '' == $t_warning ),
( '' != $t_error ),
$t_error . ' ' . $t_warning
);
?>
</tr>
</table>
<?php
Expand Down

0 comments on commit 5fea91c

Please sign in to comment.