From 4d3549d213a2d4ef4654d111a0814e9b9482344b Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Sun, 7 Feb 2021 14:08:38 +0800 Subject: [PATCH] * Fix bug #10961. --- module/custom/model.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/module/custom/model.php b/module/custom/model.php index 4c31d66833..4000333987 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -583,7 +583,17 @@ class customModel extends model { foreach($systemFields as $method => $fields) { - $systemField = $this->config->$moduleName->$method->requiredFields; + $optionFields = isset($this->config->custom->fieldList[$moduleName][$method]) ? explode(',', $this->config->custom->fieldList[$moduleName][$method]) : array(); + $systemFieldList = explode(',', $this->config->$moduleName->$method->requiredFields); + foreach($optionFields as $field) + { + if(in_array($field, $systemFieldList)) + { + $key = array_search($field, $systemFieldList); + unset($systemFieldList[$key]); + } + } + $systemField = implode(',', $systemFieldList); /* Keep the original required fields when the fields is empty. */ if(!isset($data->requiredFields[$method]))