When adding a new server with the Binding Method of "Anonymous Bind" the page will not save and throws the following php error.
The website encountered an unexpected error. Please try again later.
Error: Call to a member function get() on null in Drupal\ldap_servers\Form\ServerForm->save() (line 501 of /Users//d8/modules/contrib/ldap/ldap_servers/src/Form/ServerForm.php).
Line 498 just above it says in the comments, "If there isn't a password then load the existing one". There will not be a password for anonymous binding so this code always runs. It then tries to load a server that doesn't exist yet.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | ldap_server_anonymous-2719827-5.patch | 1.06 KB | grahl |
Comments
Comment #2
queenvictoria commentedGood catch. I'll fix that thanks.
Comment #4
queenvictoria commentedComment #5
grahlThe issue is not fully fixed, when you do use a service account and no password is set for some reason (even if it should be), saving also fails. Attached is a quick check for this. One could amend that to provide the user some feedback that the password was missing, or have more stricter form checking (this seems a bit broken currently, with the fields being read-only for service accounts).
Comment #6
larowlanComment #7
larowlanThanks!