Problem/Motivation

The call to \Drupal\ldap_servers\LdapGroupManager::groupMembershipsFromEntryRecursive at ldap_servers/src/LdapGroupManager.php:591 happens even if $this->server->get('grp_nested') is FALSE.

This causes one unnecessary LDAP query, because the stop condition of \Drupal\ldap_servers\LdapGroupManager::groupMembershipsFromEntryRecursive is only checked at the end of the function.

Proposed resolution

Add a condition similar to ldap_servers/src/LdapGroupManager.php:69 to the call site.

Remaining tasks

  • implement solution
  • discuss necessity of tests
  • review implementation

User interface changes

No user interface changes.

API changes

No API changes.

Data model changes

No data model changes.

Issue fork ldap-3540940

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tgauges created an issue. See original summary.

tgauges’s picture

Assigned: tgauges » Unassigned
Issue summary: View changes
Status: Active » Needs review

Please take a look :)

tgauges’s picture

Assigned: Unassigned » tgauges
Issue summary: View changes
Status: Needs review » Needs work

I put too much trust in the (locally running) tests. My implementation is not correct: $all_group_dns will never include any values.

tgauges’s picture

Assigned: tgauges » Unassigned
Issue summary: View changes
Status: Needs work » Needs review

I fixed the issue I encountered in my project. But now I don't trust the locally running tests and the pipeline tests don't work at all: https://git.drupalcode.org/project/ldap/-/pipelines

Is it necessary to implement new test cases?