Skip to content

occ user:sync-account-data without function #57482

@SystemKeeper

Description

@SystemKeeper

The command occ user:sync-account-data currently updates the displayname, when the backend implements IGetDisplayNameBackend:

if ($user->getBackend() instanceof IGetDisplayNameBackend) {
try {
$displayNameProperty = $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME);
} catch (PropertyDoesNotExistException) {
$displayNameProperty = null;
}
if (!$displayNameProperty || $displayNameProperty->getValue() !== $user->getDisplayName()) {
$output->writeln($user->getUID() . ' - updating changed display name');
$account->setProperty(
IAccountManager::PROPERTY_DISPLAYNAME,
$user->getDisplayName(),
$displayNameProperty ? $displayNameProperty->getScope() : IAccountManager::SCOPE_PRIVATE,
$displayNameProperty ? $displayNameProperty->getVerified() : IAccountManager::NOT_VERIFIED,
$displayNameProperty ? $displayNameProperty->getVerificationData() : ''
);
$changed = true;
}
}

But the account data that is used to compare the displayname, always return the up-to-date displayname:

if ($user->getBackend() instanceof IGetDisplayNameBackend) {
$property = $account->getProperty(self::PROPERTY_DISPLAYNAME);
$account->setProperty(self::PROPERTY_DISPLAYNAME, $user->getDisplayName(), $property->getScope(), $property->getVerified());
}

(implemented at #39770)

So if I am not mistaken, occ user:sync-account-data is basically a NOP?

CC @juliusknorr as creator of the occ command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap33-feedbackbug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions