From 841c529107c4ee5c253d34ca6b1d1bc466b30c1f Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 15 Feb 2021 23:26:18 +0100 Subject: [PATCH] fix check for required firstname/name/company in Customers.update(), fixes #915 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/Customers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 1d9cad29..64ddd491 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -873,7 +873,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $email = $this->getParam('email', true, $idna_convert->decode($result['email'])); $name = $this->getParam('name', true, $result['name']); $firstname = $this->getParam('firstname', true, $result['firstname']); - $company_required = (! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname)); + $company_required = empty($result['company']) && ((! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname))); $company = $this->getParam('company', ($company_required ? false : true), $result['company']); $street = $this->getParam('street', true, $result['street']); $zipcode = $this->getParam('zipcode', true, $result['zipcode']);