diff --git a/module/chart/model.php b/module/chart/model.php index b46d3dafd7..4f048b9a66 100644 --- a/module/chart/model.php +++ b/module/chart/model.php @@ -741,9 +741,9 @@ class chartModel extends model break; } - if($sql and $field and in_array($type, array('user', 'product', 'project', 'execution', 'dept', 'option', 'object'))) + if($sql and $field and $saveAs and in_array($type, array('user', 'product', 'project', 'execution', 'dept', 'option', 'object'))) { - $options = $this->getOptionsFromSql($source, $field, $saveAs); + $options = $this->getOptionsFromSql($sql, $field, $saveAs); } return array_filter($options); diff --git a/module/screen/model.php b/module/screen/model.php index 4b8fb0302a..3371eb75af 100644 --- a/module/screen/model.php +++ b/module/screen/model.php @@ -1185,7 +1185,7 @@ class screenModel extends model break; } - if($sql and $field and in_array($type, array('user', 'product', 'project', 'execution', 'dept', 'project.status', 'option', 'object'))) + if($sql and $field and $saveAs and in_array($type, array('user', 'product', 'project', 'execution', 'dept', 'project.status', 'option', 'object'))) { $options = $this->getOptionsFromSql($sql, $field, $saveAs); }