From 5fea91cc88e9a31303f96438c7b11f90ab4cda1c Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Wed, 29 Apr 2015 13:07:37 +0200 Subject: [PATCH] Fix system notice in installer 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 --- admin/install.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/admin/install.php b/admin/install.php index 39dbdd3ac8..320c522bd9 100644 --- a/admin/install.php +++ b/admin/install.php @@ -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; } ?> @@ -462,11 +463,14 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes Checking Database Server Version - Running ' . string_attribute( $f_db_type ) . ' version ' . nl2br( $t_version_info['description'] ); - ?> + Running ' . string_attribute( $f_db_type ) + . ' version ' . nl2br( $t_version_info['description'] ); + } +?> - + 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 + ); +?>