From 5e7dea495764fe8c4e298b6f71d805f2eba29236 Mon Sep 17 00:00:00 2001 From: albertlast Date: Sat, 8 Aug 2026 19:47:12 +0200 Subject: [PATCH] Reads the draft autosave frequency from the setting that exists "How often should drafts be autosaved?" in Admin -> Posts and Topics -> Drafts writes drafts_autosave_frequency, but the three places that hand the interval to the editor read masterAutoSaveDraftsDelay, which is the SMF 2.0 name. Nothing in 3.0 writes it, so the empty() check always won and every autosave ran at the hard coded 60 seconds, on posting, on quick reply and on personal messages alike. 2.1 already called this drafts_autosave_frequency, and Editor.php reads it under that name a few hundred lines away, so these three were the odd ones out. With the setting at 30 seconds the editor options rendered "iFreq": 60000 on all three pages before, and "iFreq": 30000 after. Signed-off-by: Mathias Papenbrock Signed-off-by: albertlast --- Sources/Actions/Display.php | 2 +- Sources/Actions/Post.php | 2 +- Sources/PersonalMessage/PM.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Actions/Display.php b/Sources/Actions/Display.php index db026388b4..dd97e07d06 100644 --- a/Sources/Actions/Display.php +++ b/Sources/Actions/Display.php @@ -1315,7 +1315,7 @@ protected function loadEditor(): void 'sLastNote' => 'draft_lastautosave', 'sLastID' => 'id_draft', 'sQueryParams' => 'action=post2;board=' . (Board::$info->id ?? 0), - 'iFreq' => empty(Config::$modSettings['masterAutoSaveDraftsDelay']) ? 60000 : Config::$modSettings['masterAutoSaveDraftsDelay'] * 1000, + 'iFreq' => empty(Config::$modSettings['drafts_autosave_frequency']) ? 60000 : Config::$modSettings['drafts_autosave_frequency'] * 1000, ]; } diff --git a/Sources/Actions/Post.php b/Sources/Actions/Post.php index 939f51e19f..2758e6459a 100644 --- a/Sources/Actions/Post.php +++ b/Sources/Actions/Post.php @@ -1776,7 +1776,7 @@ protected function loadEditor(): void 'sLastNote' => 'draft_lastautosave', 'sLastID' => 'id_draft', 'sQueryParams' => 'action=post2;board=' . (Board::$info->id ?? 0), - 'iFreq' => empty(Config::$modSettings['masterAutoSaveDraftsDelay']) ? 60000 : Config::$modSettings['masterAutoSaveDraftsDelay'] * 1000, + 'iFreq' => empty(Config::$modSettings['drafts_autosave_frequency']) ? 60000 : Config::$modSettings['drafts_autosave_frequency'] * 1000, ]; } diff --git a/Sources/PersonalMessage/PM.php b/Sources/PersonalMessage/PM.php index cbd788e38f..68f36cddbf 100644 --- a/Sources/PersonalMessage/PM.php +++ b/Sources/PersonalMessage/PM.php @@ -801,7 +801,7 @@ public static function compose(): void 'sLastNote' => 'draft_lastautosave', 'sLastID' => 'id_draft', 'sQueryParams' => 'action=pm;sa=send2', - 'iFreq' => empty(Config::$modSettings['masterAutoSaveDraftsDelay']) ? 60000 : Config::$modSettings['masterAutoSaveDraftsDelay'] * 1000, + 'iFreq' => empty(Config::$modSettings['drafts_autosave_frequency']) ? 60000 : Config::$modSettings['drafts_autosave_frequency'] * 1000, ]; }