From df33d314a423138211ce4c7620d521ed79e6f80b Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 8 Dec 2020 21:32:03 +0000 Subject: [PATCH] Fix for custom fields issue when downloading list with no custom fields itself git-svn-id: svn://192.168.202.10@3336 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/list_download.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/vicidial/list_download.php b/www/vicidial/list_download.php index 8e14c7a4..afa59994 100644 --- a/www/vicidial/list_download.php +++ b/www/vicidial/list_download.php @@ -4,7 +4,7 @@ # downloads the entire contents of a vicidial list ID to a flat text file # that is tab delimited # -# Copyright (C) 2019 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -36,6 +36,7 @@ # 170409-1556 - Added IP List validation code # 180330-1414 - Added option for downloading of CID Groups # 190926-1015 - Fix for PHP7 +# 201208-1630 - Fix for custom fields issue when downloading list with no custom fields itself # $startMS = microtime(); @@ -679,6 +680,14 @@ if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) $valid_custom_table=1; } } + if ($valid_custom_table < 1) + { + $stmt="SHOW TABLES LIKE \"custom\_%\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_to_mysqli($stmt, $link); + $tablecount_to_print = mysqli_num_rows($rslt); + $valid_custom_table = $tablecount_to_print; + } } if ($valid_custom_table > 0) {