From 9f5029aa0f28879f18cbaa3c74df85e430139ca4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Dec 2019 19:17:53 +0100 Subject: [PATCH] Fix warning --- htdocs/core/commonfieldsinexport.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/commonfieldsinexport.inc.php b/htdocs/core/commonfieldsinexport.inc.php index 034fbcd4679..9f416079cce 100644 --- a/htdocs/core/commonfieldsinexport.inc.php +++ b/htdocs/core/commonfieldsinexport.inc.php @@ -19,7 +19,7 @@ if (class_exists($keyforclass)) $fieldname = $keyforalias . '.' . $keyfield; $fieldlabel = ucfirst($valuefield['label']); $typeFilter = "Text"; - $typefield=preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double + $typefield = preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double switch ($typefield) { case 'int': case 'integer': @@ -47,7 +47,10 @@ if (class_exists($keyforclass)) * break; */ } - $helpfield=preg_replace('/\(.*$/', '', $valuefield['help']); + $helpfield = ''; + if (! empty($valuefield['help'])) { + $helpfield = preg_replace('/\(.*$/', '', $valuefield['help']); + } if ($valuefield['enabled']) { $this->export_fields_array[$r][$fieldname] = $fieldlabel; $this->export_TypeFields_array[$r][$fieldname] = $typeFilter;