Skip to content

Commit 542df2f

Browse files
CarlSchwanbackportbot[bot]
authored andcommitted
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>
1 parent 72eea97 commit 542df2f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/private/Group/Group.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,22 @@ public function getDisplayName(): string {
7676
#[\Override]
7777
public function setDisplayName(string $displayName): bool {
7878
$displayName = trim($displayName);
79+
$changed = false;
7980
if ($displayName !== '') {
8081
$this->dispatcher->dispatchTyped(new BeforeGroupChangedEvent($this, 'displayName', $displayName, $this->displayName));
8182
$oldDisplayName = $this->displayName;
8283
foreach ($this->backends as $backend) {
8384
if (($backend instanceof ISetDisplayNameBackend)
8485
&& $backend->setDisplayName($this->gid, $displayName)) {
8586
$this->displayName = $displayName;
86-
$this->dispatcher->dispatchTyped(new GroupChangedEvent($this, 'displayName', $displayName, $oldDisplayName));
87-
return true;
87+
$changed = true;
8888
}
8989
}
9090
}
91+
if ($changed) {
92+
$this->dispatcher->dispatchTyped(new GroupChangedEvent($this, 'displayName', $displayName, $oldDisplayName));
93+
return true;
94+
}
9195
return false;
9296
}
9397

0 commit comments

Comments
 (0)