Cleaned event create control for centralized management
This commit is contained in:
parent
3d3beca727
commit
a6936f16d5
|
@ -182,20 +182,9 @@ class Event extends Entity
|
||||||
*/
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
global $config;
|
|
||||||
|
|
||||||
if (is_metaconsole() === false && isset($config['centralized_management']) === true
|
|
||||||
&& (bool) $config['centralized_management'] === true
|
|
||||||
) {
|
|
||||||
throw new \Exception(
|
|
||||||
'error, cannot save in centralized management environment.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$values = $this->fields;
|
$values = $this->fields;
|
||||||
// Clean null fields.
|
// Clean null fields.
|
||||||
foreach ($values as $k => $v) {
|
foreach ($values as $k => $v) {
|
||||||
hd('"'.$k.'" "'.$v.'"', true);
|
|
||||||
if ($v === null) {
|
if ($v === null) {
|
||||||
unset($values[$k]);
|
unset($values[$k]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue