[horde] Ldap v3.0.0alpha7, kronolith and no more existent Ldap group

Jean Charles Delépine delepine at u-picardie.fr
Fri May 16 17:49:43 UTC 2025


Quoting Jean Charles Delépine <delepine at u-picardie.fr>:

> Quoting Jean Charles Delépine <delepine at u-picardie.fr>:
>
>> Context : one calendar shared to peoples in no more existent ldap group.
>>
>> HORDE: Next TypeError: ldap_free_result(): Argument #1 ($result)  
>> must be of type LDAP\Result, bool given in  
>> /var/www/horde/vendor/horde/ldap/lib/Horde/Ldap/Search.php:123
>
> For now, I just wrapped the ldap_free_result call in an if to check  
> the type of $this->_search.
>
> That said, the underlying issue is that $this->_search ends up being  
> a boolean when searching for members of a non-existent LDAP group.  
> So this fix avoids the error, but the real solution will be to  
> handle that case earlier.

Here it is. In vendor/horde/kronolith/lib/Kronolith.php and  
vendor/horde/nag/lib/Form/Task.php.

-                    $users = array_merge(
-                        $users,
-                        $horde_group->listUsers($group)
-                    );
+                    if ($horde_group->exists($group)) {
+                        $users = array_merge(
+                          $users,
+                          $horde_group->listUsers($group)
+		        );
+                    }

Patch is attach. I will try to set a dev env in order to be able to  
make a PR next time.

            Jean Charles Delépine

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldap-group.diff
Type: text/x-diff
Size: 1543 bytes
Desc: not available
URL: <https://lists.horde.org/archives/horde/attachments/20250516/8b33fab5/attachment.diff>


More information about the horde mailing list