diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 045bb1ddbcf..b2c650e10e1 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1412,7 +1412,6 @@ abstract class DolibarrModules global $conf; $error=0; - $entity=$conf->entity; if (is_array($this->module_parts) && ! empty($this->module_parts)) { @@ -1420,6 +1419,7 @@ abstract class DolibarrModules { if (is_array($value) && count($value) == 0) continue; // Discard empty arrays + $entity=$conf->entity; // Reset the current entity $newvalue = $value; // Serialize array parameters @@ -1431,6 +1431,11 @@ abstract class DolibarrModules $newvalue = json_encode($value['data']); if (isset($value['entity'])) $entity = $value['entity']; } + else if (isset($value['data']) && !is_array($value['data'])) + { + $newvalue = $value['data']; + if (isset($value['entity'])) $entity = $value['entity']; + } else { $newvalue = json_encode($value); diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index b40b0f9fd4c..8323b4aa3eb 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -311,7 +311,7 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f } // For multicompany - //$out.="&entity=".$conf->entity; // This should not be into link. Link contains already a ref of an object that allow to retreive entity + $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities return $out; }