From 0a23698b7e45ae01bbf8fb722a31f0e1765008dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 19 Dec 2018 07:35:16 +0100 Subject: [PATCH] Fixed Loading of UDF Fields in FAS if there are only UDF Fields for Persons --- application/core/DB_Model.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index b636c3fe5..16b9f2da9 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -42,6 +42,8 @@ class DB_Model extends FHC_Model // Loads DB conns and confs $this->load->database($dbtype); + $this->load->model('system/UDF_model', 'UDFModel'); + // Loads the UDF library $this->load->library('UDFLib'); // Loads the logs library @@ -681,7 +683,16 @@ class DB_Model extends FHC_Model */ public function hasUDF() { - return $this->fieldExists(UDFLib::COLUMN_NAME); + if($this->fieldExists(UDFLib::COLUMN_NAME)) + { + $resultUDFsDefinitions = $this->UDFModel->getUDFsDefinitions($this->dbTable); + if (hasData($resultUDFsDefinitions)) + return true; + else + return false; + } + else + return false; } /**