[3.0] Say whether the label being put on a PM is going on or coming off - #9462
Open
albertlast wants to merge 1 commit into
Open
[3.0] Say whether the label being put on a PM is going on or coming off#9462albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
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 <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
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 two apart, and
PersonalMessage::applyActions()does not try. It reads anadd_orrem_prefix and skips anything else:So picking a label from that drop down did nothing at all.
smf_pm_labeled_messagesstays empty, no error is logged, and the page reloads looking exactly as it did.The values are written this way because SMF 2.1 read a bare value as "toggle this label" — it had an
else { $type = 'unk'; }branch, and further down,if (array_key_exists(...) && $type !== 'add') unset(...); elseif ($type !== 'rem') .... 3.0 dropped that branch and kept the markup, which is why the drop down looks fine and does nothing.The template knows perfectly well which of the two lists it is drawing, so it says so. That is also exactly what
loadLabelChoices()in this same file builds for the whole-folder drop down ("add_" + i,"rem_" + i), which has been the only working way to label a PM.Verified the round trip on the inbox:
pm_labeled_messagesadd_2 Alpha,add_3 Betaadd_2add_3 Beta,rem_-1 Inbox,rem_2 Alpha2-1rem_2add_2 Alpha,add_3 BetaNothing new in the error log either way.
Issues References (Fixes|Related|Closes)
n/a