mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
Fix Servicelicense and Servicedownloadable product period bug (#1005)
Fix issue with the Servicelicense and Servicedownloadable modules when product configuration not defined causing cart/order data to be lost (resulting in invalid period exception).
This commit is contained in:
1 parent
48b16e6462
commit
9bc5e06e95
2 files changed
+8
-10
No files matched your search
@@ -43,15 +43,16 @@ class Service implements InjectionAwareInterface
|
||||
|
||||
public function attachOrderConfig(\Model_Product $product, array &$data)
|
||||
{
|
||||
$c = json_decode($product->config, 1);
|
||||
$config = $product->config;
|
||||
isset($config) ? $config = json_decode($config, true) : $config = [];
|
||||
$required = [
|
||||
'filename' => 'Product is not configured completely.',
|
||||
];
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $c);
|
||||
$this->di['validator']->checkRequiredParamsForArray($required, $config);
|
||||
|
||||
$data['filename'] = $c['filename'];
|
||||
$data['filename'] = $config['filename'];
|
||||
|
||||
return array_merge($c, $data);
|
||||
return array_merge($config, $data);
|
||||
}
|
||||
|
||||
public function validateOrderData(array &$data)
|
||||
|
||||
@@ -48,12 +48,9 @@ class Service implements InjectionAwareInterface
|
||||
*/
|
||||
public function attachOrderConfig(\Model_Product $product, array $data)
|
||||
{
|
||||
$c = json_decode($product->config, 1);
|
||||
if (!is_array($c)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_merge($c, $data);
|
||||
$config = $product->config;
|
||||
isset($config) ? $config = json_decode($config, true) : $config = [];
|
||||
return array_merge($config, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user