AdvancedFlagging: Changing the configuration for a flag type wipes out the Smokey feedback option
Steps to reproduce:
-
Go to the bottom of a page and click the "AdvancedFlagging: edit comments and flags"
-
Click "Edit" to change the configuration for a flag. For example Spam.
-
Save (does not matter if anything option is changed or not). At this point the problem has manifested. Go through the rest of the steps to see it
-
Reload the page.
-
Repeat 1. and 2.
Expected: The choice for "Feedback to Smokey" should remain to whatever was before saving. Actual: The choice is wiped and set to "(none)".
This has been fixed as of 2023-01-23, however, that fix is not released yet. The latest release for AdvancedFlagging is from 2023-01-14.
The short summary of the technical issue is that for for Smokey the possible flag values are 'tpu-', 'tp-', 'fp-', 'naa-. However, when the ID for the radio button is generated via id: `advanced-flagging-${idedName}-feedback-${feedback}-${flagId}` that results in an ID with a double dash near the end.
<input class="s-radio" type="radio" id="advanced-flagging-Smokey-feedback-tpu--1" name="advanced-flagging-1-feedback-to-Smokey" data-feedback="">
<label class="s-label flex--item" for="advanced-flagging-Smokey-feedback-tpu--1">tpu-</label>
When data-feedback is to be populated, the value for it (in the latest release) comes from const [feedback] = radio.id.split('-').slice(-2, -1); which produces an empty string. Then saving takes that empty value for the Smokey configuration.