diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php
index 82c0c743cfd..5b82a96ccb7 100644
--- a/htdocs/webportal/class/html.formwebportal.class.php
+++ b/htdocs/webportal/class/html.formwebportal.class.php
@@ -414,7 +414,6 @@ class FormWebPortal extends Form
$classpath = $InfoFieldList[1];
$filter = empty($InfoFieldList[3]) ? '' : $InfoFieldList[3];
$sortfield = empty($InfoFieldList[4]) ? '' : $InfoFieldList[4];
-
if (!empty($classpath)) {
dol_include_once($classpath);
@@ -519,6 +518,10 @@ class FormWebPortal extends Form
}
}
+ if (!empty($objecttmp->isextrafieldmanaged)) {
+ $sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . "_extrafields as e ON t.rowid = e.fk_object";
+ }
+
// Add where from hooks
$parameters = array(
'object' => $objecttmp,
diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php
index e51e85d9deb..0de3bff13fe 100755
--- a/scripts/user/sync_groups_ldap2dolibarr.php
+++ b/scripts/user/sync_groups_ldap2dolibarr.php
@@ -152,7 +152,7 @@ if ($result >= 0) {
// Warning $ldapuser has a key in lowercase
foreach ($ldaprecords as $key => $ldapgroup) {
$group = new UserGroup($db);
- $group->fetch(0, $ldapgroup[getDolGlobalString('LDAP_KEY_GROUPS')]);
+ $group->fetch(0, $ldapgroup[getDolGlobalString('LDAP_KEY_GROUPS')], true); // Fetch LDAP groups AND members
$group->name = $ldapgroup[getDolGlobalString('LDAP_GROUP_FIELD_FULLNAME')] ?? '';
$group->nom = $group->name; // For backward compatibility
$group->note = $ldapgroup[getDolGlobalString('LDAP_GROUP_FIELD_DESCRIPTION')] ?? '';