From 39eab6d88d83f46278802f10a2064d03ca327003 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 3 Apr 2018 14:38:20 +0200 Subject: [PATCH 1/3] Fix service creation, right is tested regarding the product type --- htdocs/product/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f65898bda68..9db9c156bf8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -94,6 +94,8 @@ if ($id > 0 || ! empty($ref)) if (! empty($conf->product->enabled)) $upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos"; else $upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos"; } +} else { + $object->type = $type; } $modulepart='product'; From 0c3b92f09ace2a565877b89a753b6fc8c89f42c2 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 3 Apr 2018 14:53:57 +0200 Subject: [PATCH 2/3] Better fix --- htdocs/product/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9db9c156bf8..7ddf36f208b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -77,6 +77,7 @@ $duration_unit = GETPOST('duration_unit'); if (! empty($user->societe_id)) $socid=$user->societe_id; $object = new Product($db); +$object->type = $type; $extrafields = new ExtraFields($db); // fetch optionals attributes and labels @@ -94,8 +95,6 @@ if ($id > 0 || ! empty($ref)) if (! empty($conf->product->enabled)) $upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos"; else $upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2),1,1).'/'.substr(substr("000".$object->id, -2),0,1).'/'.$object->id."/photos"; } -} else { - $object->type = $type; } $modulepart='product'; From 55719cd166ba1ec0dc8211ebcacdf9d4eb888bfa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Apr 2018 16:20:50 +0200 Subject: [PATCH 3/3] Update card.php --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 7ddf36f208b..43b4ba581a2 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -77,7 +77,7 @@ $duration_unit = GETPOST('duration_unit'); if (! empty($user->societe_id)) $socid=$user->societe_id; $object = new Product($db); -$object->type = $type; +$object->type = $type; // so test later to fill $usercancxxx is correct $extrafields = new ExtraFields($db); // fetch optionals attributes and labels