fix(group): Set the display name on every backends that supports it

Otherwise it apply the change only to the group backend with
ISetDisplaynameBackend

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
pull/63246/head
Carl Schwan 6 days ago
parent b85f3837dc
commit 8a033ccafb
No known key found for this signature in database
GPG Key ID: 02325448204E452A
  1. 8
      lib/private/Group/Group.php

@ -79,6 +79,7 @@ class Group implements IGroup {
#[\Override]
public function setDisplayName(string $displayName): bool {
$displayName = trim($displayName);
$changed = false;
if ($displayName !== '') {
$this->dispatcher->dispatchTyped(new BeforeGroupChangedEvent($this, 'displayName', $displayName, $this->displayName));
$oldDisplayName = $this->displayName;
@ -86,11 +87,14 @@ class Group implements IGroup {
if (($backend instanceof ISetDisplayNameBackend)
&& $backend->setDisplayName($this->gid, $displayName)) {
$this->displayName = $displayName;
$this->dispatcher->dispatchTyped(new GroupChangedEvent($this, 'displayName', $displayName, $oldDisplayName));
return true;
$changed = true;
}
}
}
if ($changed) {
$this->dispatcher->dispatchTyped(new GroupChangedEvent($this, 'displayName', $displayName, $oldDisplayName));
return true;
}
return false;
}

Loading…
Cancel
Save