From 29031e1fd8ffe6667e7d3f37789f3f84de9a6f23 Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Wed, 26 Apr 2023 10:01:18 +0000 Subject: [PATCH] * Fix bug #34687. --- module/chart/model.php | 13 +++++++------ module/pivot/model.php | 12 +++++++----- module/screen/model.php | 12 +++++++----- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/module/chart/model.php b/module/chart/model.php index d6afa91b19..b3771a6470 100644 --- a/module/chart/model.php +++ b/module/chart/model.php @@ -615,17 +615,18 @@ class chartModel extends model if($field) { $path = $this->app->getModuleRoot() . 'dataview' . DS . 'table' . DS . "$object.php"; - if(!is_file($path)) return; - - include $path; - $options = $schema->fields[$field]['options']; + if(is_file($path)) + { + include $path; + $options = $schema->fields[$field]['options']; + } } break; case 'object': if($field) { - $table = zget($this->config->objectTables, $object); - $options = $this->dao->select("id, {$field}")->from($table)->fetchPairs(); + $table = zget($this->config->objectTables, $object); + if($table) $options = $this->dao->select("id, {$field}")->from($table)->fetchPairs(); } break; case 'string': diff --git a/module/pivot/model.php b/module/pivot/model.php index c5aa993ce5..aefee01828 100644 --- a/module/pivot/model.php +++ b/module/pivot/model.php @@ -1917,16 +1917,18 @@ class pivotModel extends model if($field) { $path = $this->app->getModuleRoot() . 'dataview' . DS . 'table' . DS . "$object.php"; - include $path; - - $options = $schema->fields[$field]['options']; + if(is_file($path)) + { + include $path; + $options = $schema->fields[$field]['options']; + } } break; case 'object': if($field) { - $table = zget($this->config->objectTables, $object); - $options = $this->dao->select("id, {$field}")->from($table)->fetchPairs(); + $table = zget($this->config->objectTables, $object); + if($table) $options = $this->dao->select("id, {$field}")->from($table)->fetchPairs(); } break; case 'string': diff --git a/module/screen/model.php b/module/screen/model.php index 7fd730f7b4..4b211cb96d 100644 --- a/module/screen/model.php +++ b/module/screen/model.php @@ -746,16 +746,18 @@ class screenModel extends model if($field) { $path = $this->app->getModuleRoot() . 'dataview' . DS . 'table' . DS . "$object.php"; - include $path; - - $options = $schema->fields[$field]['options']; + if(is_file($path)) + { + include $path; + $options = $schema->fields[$field]['options']; + } } break; case 'object': if($field) { - $table = zget($this->config->objectTables, $object); - $options = $this->dao->select("id, {$field}")->from($table)->fetchPairs(); + $table = zget($this->config->objectTables, $object); + if($table) $options = $this->dao->select("id, {$field}")->from($table)->fetchPairs(); } break; case 'string':