Closed (fixed)
Project:
Lightweight Directory Access Protocol
Version:
8.x-4.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2021 at 21:44 UTC
Updated:
24 Aug 2021 at 18:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
larisse commentedI'm not able to reproduce this error. What Drupal version are you using?
Comment #3
luongosb commentedDrupal 9.2.3. It is happening on every site I have upgraded from Drupal 8 and LDAP 8.x-3.0-beta to 8.x-4.0-beta.
Comment #5
joegl commentedI was just trying to preview my comment and then saved it and for some reason I created a fork?
Comment #6
joegl commentedI've poked at the code a little.
The `LdapUserManager` class extends the `LdapBaseManager` which has the following two methods:
1. `setServer()` (expects a Entity\Server object as argument)
2. `setServerById()` (expects the id of an Entity\Server object)
In the admin form there is a config value for `ldap_user.settings` called `drupalAcctProvisionServer`. This is a radio field set a string value of the server name.
This `drupalAcctProvisionServer`config value is getting loaded into BOTH of the above methods directly in many places throughout the code, and from what I can tell should be throwing errors everywhere:
In `ldap_user/ldap_user.module` it uses `SetServerById()`:
$ldap_user_manager->setServerById($config->get('drupalAcctProvisionServer'));In `ldap_user/src/Form/LdapUserTestForm.php` it uses `SetServer()`:
$this->ldapUserManager->setServer($config['drupalAcctProvisionServer']);This is the line of code mentioned in this issue.
In `ldap_user/src/Processor/DrupalUserProcessor.php` it loads the server this way:
There are also a lot of files that setup a $server property on the class (as a strict Entity\Server object type) and then load it like this:
$server = $this->config->get('drupalAcctProvisionServer');Comment #7
larisse commentedHi! Can you test if this patch will work, please?
Comment #8
luongosb commentedI applied the patch, but it didn't resolve the issue. Same error. The issue I am having is as mentioned in the issue and in #6:
Comment #9
larisse commentedComment #10
luongosb commentedJust tested this on a new install and ran into the error.
Comment #11
grahlWhile we have this test form for backwards compatibility under /admin/config/people/ldap/user/test it hasn't received much attention and is not really recommended as a primary debugging tool (see the ample warnings on that page) and the server test page is often a better tool.
Apparently it wasn't kept up to date with schema changes and issues crept in. Combining joegl's input and larisse's patch should be sufficient now.
Please reopen if you can still reproduce this on latest dev.
Comment #14
luongosb commentedThanks, grahl. The commit resolved the issue.