From c0c49f53cbf50ecc4d2c46df269d194280c45746 Mon Sep 17 00:00:00 2001 From: omogenot Date: Thu, 27 Feb 2025 17:21:31 +0100 Subject: [PATCH 1/2] Update export_excel2007.modules.php Fix Excel Export for zero values --- htdocs/core/modules/export/export_excel2007.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 1f9a804da46..d5bdd998b46 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -336,9 +336,9 @@ class ExportExcel2007 extends ModeleExports continue; } - $newvalue = !empty($objp->$alias) ? $objp->$alias : ''; + // $newvalue = !empty($objp->$alias) ? $objp->$alias : ''; - $newvalue = $this->excel_clean($newvalue); + $newvalue = $this->excel_clean($objp->$alias); $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { From c562c6ebab72a470242123efee288404c0bc785a Mon Sep 17 00:00:00 2001 From: omogenot Date: Wed, 5 Mar 2025 13:16:30 +0100 Subject: [PATCH 2/2] Add is_numeric condition to check empty values --- htdocs/core/modules/export/export_excel2007.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index d5bdd998b46..cc029b3cc4e 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -336,9 +336,9 @@ class ExportExcel2007 extends ModeleExports continue; } - // $newvalue = !empty($objp->$alias) ? $objp->$alias : ''; + $newvalue = (!empty($objp->$alias) || (is_numeric($objp->alias))) ? $objp->$alias : ''; - $newvalue = $this->excel_clean($objp->$alias); + $newvalue = $this->excel_clean($newvalue); $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) {