check user state when fetching to avoid dealing with offline objects, fixes #9502 #9640
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.
The problem stems from a refactor done for Nextcloud 13 to fasten up retrieving the users from LDAP. Instead of applying data every time a user is fetched, this is now done in a background job. However in that process, if retrieved users were flagged as deleted, the flag was removed. This does not happen anymore, leading this into this bug.
Reproduction steps:
occ user:setting $USERID user_ldap isDeleted 1
(you can get the $USERID from ldap_user_mappings table)occ ldap:show-remnants
before this patch it just stays empty,
Call to undefined method OCA\\User_LDAP\\User\\OfflineUser::composeAndStoreDisplayName()
is logged. Now, the users are all shown, and the flag was removed which is indicated by the missing the user not listed anymore when you callocc ldap:show-remnants
again.