From 285c42ab14199ab1c6a5f32cf1590e7a0aa3be49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Tue, 23 May 2023 17:18:19 +0200 Subject: [PATCH] Fix user tests, avoid setting enabled state to the same value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/User/User.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 8830b4aae71..3b7123bd575 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -467,10 +467,11 @@ class User implements IUser { return (bool) $this->enabled; }; $this->backend->setUserEnabled($this->uid, $enabled, $queryDatabaseValue, $setDatabaseValue); - } else { + if ($oldStatus !== $enabled) { + $this->triggerChange('enabled', $enabled, $oldStatus); + } + } elseif ($oldStatus !== $enabled) { $setDatabaseValue($enabled); - } - if ($oldStatus !== $enabled) { $this->triggerChange('enabled', $enabled, $oldStatus); } } -- 2.39.5