From a8e4e87dc2f3665b3e6d7615f5cfb68a7ca8f261 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Sat, 23 Dec 2023 15:00:15 +0800 Subject: [PATCH] * Fix bug #42267. --- framework/helper.class.php | 2 +- module/productplan/control.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/helper.class.php b/framework/helper.class.php index 854ff81b5b..5592d60fee 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -379,7 +379,7 @@ class helper extends baseHelper case 'bool': return (bool)$value; case 'array': - return array_filter((array)$value); + return array_filter((array)$value, function($var){return ($var === '0' || !empty($var));}); case 'object': return (object)$value; case 'datetime': diff --git a/module/productplan/control.php b/module/productplan/control.php index 54393f7143..f1e00636b6 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -70,7 +70,6 @@ class productplan extends control if(!empty($_POST)) { $planData = form::data()->get(); - if(empty($planData->branch)) $planData->branch = '0'; $planID = $this->productplan->create($planData, (int)$this->post->future); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('productplan', $planID, 'opened');