This happens if you select multiple users and try to edit them. $dn is an array and the LDAP method expects a string.