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

Jean Charles Delépine delepine at u-picardie.fr
Fri May 16 14:56:44 UTC 2025


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

> Hello,
>
> 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.

     public function __destruct()
     {
         if ($this->_search instanceof \LDAP\Result) {
            @ldap_free_result($this->_search);
         }
     }

          Jean Charles Delépine



More information about the horde mailing list