AdvancedFlagging icon indicating copy to clipboard operation
AdvancedFlagging copied to clipboard

AdvancedFlagging: Changing the configuration for a flag type wipes out the Smokey feedback option

Open PurpleMagick opened this issue 1 year ago • 0 comments

Steps to reproduce:

  1. Go to the bottom of a page and click the "AdvancedFlagging: edit comments and flags" image

  2. Click "Edit" to change the configuration for a flag. For example Spam. image image

  3. 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

  4. Reload the page.

  5. 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)".

image


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.

PurpleMagick avatar May 16 '24 16:05 PurpleMagick