diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php
index 0c7f61b1082..1bd4440bf6a 100644
--- a/htdocs/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php
@@ -22,9 +22,17 @@
linkedObjectBlock;
+$objectid = $GLOBALS['object']->objectid;
+$num = count($objectid);
+
$langs->load("orders");
if ($somethingshown) { echo '
'; }
print_titre($langs->trans('RelatedOrders'));
+
?>
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 5240a60eb42..a035b0aa1f6 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -34,6 +34,9 @@
class CommonObject
{
var $db;
+
+ var $linkedObjectBlock;
+ var $objectid;
// Instantiate hook classe of thirdparty module
var $hooks=array();
@@ -1355,8 +1358,10 @@ class CommonObject
global $langs,$bc;
//print 'objecttype='.$objecttype.'
';
+
+ $this->objectid = $objectid;
- $num = sizeof($objectid);
+ $num = sizeof($this->objectid);
if ($num)
{
$classpath = $objecttype.'/class';
@@ -1374,7 +1379,7 @@ class CommonObject
{
dol_include_once("/".$classpath."/".$classfile.".class.php");
}
- $linkedObjectBlock = new $classname($this->db);
+ $this->linkedObjectBlock = new $classname($this->db);
dol_include_once('/'.$tplpath.'/tpl/linkedobjectblock.tpl.php');
return $num;