Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Teachers could not find some class groups in the share dialog. Groups that had been renamed since they were first synced were unfindable by the name shown in the UI, while unrenamed groups in the same school worked. Typing part of the group's old name found it, which was the clue.
Root cause
ClassGroupMapper::searchEntriesInner()matched the search term against thegidcolumn only, but the picker labels each hit withIGroup::getDisplayName().For LDAP groups those two are not the same string. Nextcloud has no stable internal id for groups: the gid is frozen at whatever
ldapGroupDisplayNameheld whenuser_ldapfirst mapped the group, and a later rename updates onlythe display name. So the app was searching a name no user has seen since the rename.
Neither was the group's abbreviation (its LDAP
cn) searchable, although that is how teachers and admins usually refer to a school's groups.Changes
Version1001Date20260909120000adds nullabledisplay_nameandabbreviationcolumns togroupsharemachine_groups.LdapSyncstores both on every sync:display_namefrom the configuredldapGroupDisplayNameattribute (so it matches what Nextcloud shows),abbreviationfromcn. Both come out of the LDAP record already beingfetched — no extra queries.
ClassGroupMappermatchesgid OR display_name OR abbreviation. The stale gid keeps working, so existing habits don't break.occ upgraderuns the migration.Testing
dev/ldap/rename-group.sh(new) reproduces the condition locally by renaming a seed group after it has been mapped. Verified on Nextcloud 33 with the docker LDAP:gid = 1A/display_name = Klasse 1A, and the share dialog finds the group by "Klasse", by the abbreviation, and by the stale gid. School scoping still holds — the other school's groups stay hidden.ClassGroupMapperTestcovering all three columns.phpunit43/43, Psalm clean,php-cs-fixerclean.Deployment
The search does not improve until the new columns are populated:
Existing rows keep working meanwhile — the columns match is unchanged.