mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-03 23:52:24 +01:00
Fix regression
This commit is contained in:
@@ -12148,7 +12148,17 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '')
|
||||
|
||||
$element_prop = getElementProperties($element_type);
|
||||
|
||||
if (is_array($element_prop) && isModEnabled($element_prop['module'])) {
|
||||
if ($element_prop['module'] == 'product' || $element_prop['module'] == 'service') {
|
||||
// For example, for an extrafield 'product' (shared for both product and service) that is a link to an object,
|
||||
// this is called with $element_type = 'product' when we need element properties of a service, we must return a product. If we create the
|
||||
// extrafield for a service, it is not supported and not found when editing the product/service card. So we must keep 'product' for extrafields
|
||||
// of service and we will return properties of a product.
|
||||
$ismodenabled = (isModEnabled('product') || isModEnabled('service'));
|
||||
} else {
|
||||
$ismodenabled = isModEnabled($element_prop['module']);
|
||||
}
|
||||
|
||||
if (is_array($element_prop) && $ismodenabled) {
|
||||
dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');
|
||||
|
||||
if (class_exists($element_prop['classname'])) {
|
||||
|
||||
Reference in New Issue
Block a user