diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index ab819d5f849..4bf5d9f6fcf 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8089,7 +8089,7 @@ class Form
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
* @param int<0,1> $disabled 1=Html component is disabled
* @param string $selected_input_value Value of preselected input text (for use with ajax)
- * @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Object@module:xxx' (old syntax 'Module_Object:xxx') or 'Object:options_xxx' or 'Object@module:options_xxx' (old syntax 'Module_Object:options_xxx')
+ * @param string $objectfield Object:Field that contains the definition of parent (in table $fields or $extrafields). Example: 'Object:xxx' or 'Object@module:xxx' (old syntax 'Module_Object:xxx') or 'Object:options_xxx' or 'Object@module:options_xxx' (old syntax 'Module_Object:options_xxx')
* @return string Return HTML string
* @see selectForFormsList(), select_thirdparty_list()
*/
@@ -8105,11 +8105,11 @@ class Form
$sortfield = ''; // Ensure filter has value (for static analysis)
if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield
- // Example: $objectfield = 'product:options_package'
+ // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield'
$tmparray = explode(':', $objectfield);
$objectdesc = '';
- // Load object according to $id and $element
+ // Get instance of object from $element
$objectforfieldstmp = fetchObjectByElement(0, strtolower($tmparray[0]));
$reg = array();
@@ -8128,7 +8128,7 @@ class Form
} else {
// For a property in ->fields
if (array_key_exists($tmparray[1], $objectforfieldstmp->fields)) {
- $objectdesc = $objectforfieldstmp->fields[$tmparray[1]]['type'];
+ $objectdesc = $objectforfieldstmp->fields[$tmparray[1]]['type']; // should be integer:ObjectClass...
$objectdesc = preg_replace('/^integer[^:]*:/', '', $objectdesc);
}
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 256454a3925..eca890e7be5 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -12254,10 +12254,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
/**
* Get an array with properties of an element.
*
- * @param string $elementType Element type (Value of $object->element). Example:
+ * @param string $elementType Element type (Value of $object->element or value of $object->element@$object->module). Example:
* 'action', 'facture', 'project', 'project_task' or
- * 'myobject@mymodule' or
- * 'myobject_mysubobject' (where mymodule = myobject, like 'project_task')
+ * 'myobject@mymodule' (or old syntax 'mymodule_myobject' like 'project_task')
* @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>)
* @see fetchObjectByElement(), getMultiDirOutput()
*/