From eba8390723e2c5be7a64983af74fe5691c2e0da6 Mon Sep 17 00:00:00 2001 From: albertlast Date: Sun, 9 Aug 2026 19:32:12 +0200 Subject: [PATCH] Says whether the label on a PM is being added or removed The drop down beside each message in the inbox offers two lists of labels - the ones that can be applied and the ones that can be taken off - and gave both of them a bare label ID as their value. Nothing downstream can tell those apart, and applyActions() does not try: it reads an "add_" or "rem_" prefix and ignores anything else, so choosing a label did nothing at all. SMF 2.1 read a bare value as "toggle this label", which is why the values were written this way. 3.0 dropped that branch and kept the markup. The template knows perfectly well which list it is drawing, so it says so. That is the same value loadLabelChoices() builds for the drop down that acts on the whole folder, which has been the only working way to label a PM. Signed-off-by: Mathias Albert Signed-off-by: albertlast --- Themes/default/PersonalMessage.template.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Themes/default/PersonalMessage.template.php b/Themes/default/PersonalMessage.template.php index f6995128ec..2c4b02a5ad 100644 --- a/Themes/default/PersonalMessage.template.php +++ b/Themes/default/PersonalMessage.template.php @@ -536,6 +536,9 @@ function template_single_pm($message) '; // Are there any labels which can be added to this? + // The two lists below hold the same label IDs, so say which list + // this one came from. That is what applyActions() reads, and what + // loadLabelChoices() puts on the drop down for the whole folder. if (!$message['fully_labeled']) { echo ' '; @@ -543,7 +546,7 @@ function template_single_pm($message) foreach (Utils::$context['labels'] as $label) { if (!isset($message['labels'][$label['id']])) { echo ' - '; + '; } } } @@ -555,7 +558,7 @@ function template_single_pm($message) foreach ($message['labels'] as $label) { echo ' - '; + '; } } echo '