From c220f7fd28ca39d96a467a6d7dbbbfffc54f3cc7 Mon Sep 17 00:00:00 2001 From: filip Date: Sun, 18 Sep 2016 15:12:47 +0200 Subject: bug fix: proper output if there are no differences in string comparison --- langs/report_tx_git.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'langs/report_tx_git.php') diff --git a/langs/report_tx_git.php b/langs/report_tx_git.php index ac86fefef..c7dee5b7d 100644 --- a/langs/report_tx_git.php +++ b/langs/report_tx_git.php @@ -355,7 +355,6 @@ if (0 < count($nonequal_num_of_all_strings)) { // making a list of resources with Tx/git differences ksort($tx_git_difference); -// $all_languages_with_tx_git_diff = array(); $all_resources_with_tx_git_diff = array(); foreach ($tx_git_difference as $one_language_of_tx_git_difference => $resources_with_tx_git_difference) { // $all_languages_with_tx_git_diff[] = $one_language_of_tx_git_difference; @@ -365,7 +364,6 @@ foreach ($tx_git_difference as $one_language_of_tx_git_difference => $resources_ } $all_resources_with_tx_git_diff = array_unique($all_resources_with_tx_git_diff); sort($all_resources_with_tx_git_diff, SORT_STRING); -$num_of_resources_w_difference = count($all_resources_with_tx_git_diff); // preparing a detailed strings difference html table represantation between git and tx if ($details_wanted) { @@ -416,9 +414,16 @@ if ($details_wanted) { $table_rows[] = "" . PHP_EOL; $table_rows[] = "" . PHP_EOL; - $table_w_details = (0 != $num_of_differences ? implode($table_rows) : ''); + if (0 != $num_of_differences) { + $table_w_details = implode($table_rows); + } else { + $table_w_details = ''; + $all_resources_with_tx_git_diff = array(); + } } +$num_of_resources_w_difference = count($all_resources_with_tx_git_diff); + // preparing a html table represantation of git/tx difference in number of untranslated strings $table_difference = ''; $num_for_switch_table_to_list = 15; -- cgit v1.2.1