From cb18d840249c51b42a3276714bae4839c6041460 Mon Sep 17 00:00:00 2001 From: Laurent David Date: Mon, 26 Aug 2024 08:21:48 +0200 Subject: [PATCH] Fix the disabledNote(s) field for previous releases of the plugin * We need to now use disabledNotes but still allow for disabledNote field --- application/src/Controller/ApiController.php | 3 ++- application/src/Entity/Meeting.php | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/application/src/Controller/ApiController.php b/application/src/Controller/ApiController.php index eb47843..3167c31 100644 --- a/application/src/Controller/ApiController.php +++ b/application/src/Controller/ApiController.php @@ -87,7 +87,8 @@ public function meetingEnd(string $serverID, Request $request): XmlResponse 'disableMic', 'disablePrivateChat', 'disablePublicChat', - 'disableNotes', + 'disableNotes', // This is the real name of the setting (see MDL-82389). + 'disableNote', // This was the previous name (a typo), but we need to keep it here for backward compatibility. 'lockedLayout', 'hideUserList', 'lockOnJoin', diff --git a/application/src/Entity/Meeting.php b/application/src/Entity/Meeting.php index 5148d03..d1c3982 100644 --- a/application/src/Entity/Meeting.php +++ b/application/src/Entity/Meeting.php @@ -619,6 +619,10 @@ public function setLockSetting(string $lockName, bool $value) { if (property_exists($this, $lockName)) { $this->$lockName = $value; } + // Keep the old behavior for disableNote. + if ($lockName === 'disableNote') { + $this->disableNotes = $value; + } } public function getLockSetting(string $lockName): bool { @@ -626,6 +630,10 @@ public function getLockSetting(string $lockName): bool { // If lockOnJoin not set to true, this is false for every lock. return $this->lockOnJoin && $this->$lockName; } + // Keep the old behavior for disableNote. + if ($lockName === 'disableNote') { + return $this->disableNotes; + } return false; }