Page MenuHomePhabricator

SecurePoll: Custom column labels do not appear (or do not appear correctly) [8h]
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

When selecting "Use custom messages for column labels" for a question, the custom labels either do not appear or only some of them appear.

They only appear correctly after you have attempted to submit the form (and got a validation error).

Steps to reproduce problem
  1. Go to Special:SecurePoll/create
  2. Under "Poll type", choose Range voting (histogram range)
  3. Scroll down to the first question, enter values for "Minimum", "Maximum" and "Default Score"
  4. Click Use custom messages for column labels

Expected behavior: You see three inputs appear corresponding to the three columns from step 3
Observed behavior: Nothing appears (or less than 3 inputs appear)

Environment

Browser: Firefox 78 and Chromium 83
Wiki(s): local vagrant 1.36.0-alpha (36e9014), SecurePoll 2.0.0 (d9d75af).

Screenshots (if applicable):

Before submit:

no_custom.png (602×795 px, 28 KB)

After submit:

no_custom_after.png (623×763 px, 31 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Niharika moved this task from Untriaged to Triage/To be Estimated on the Anti-Harassment board.
ARamirez_WMF renamed this task from SecurePoll: Custom column labels do not appear (or do not appear correctly) to SecurePoll: Custom column labels do not appear (or do not appear correctly) [8h].Jan 20 2021, 6:24 PM
STran added subscribers: Tchanders, STran.

Taking this alongside T272433: Fix issue with Support label being arbitrarily removed in SecurePoll poll creation page [8h] because I stumbled upon this while doing that investigation and can't investigate farther until this is resolved 😂 😭

The issue comes from the additional JS being called from ./modules/ext.securepoll.htmlform.js (which has a very misleading comment!) that has become invalid now that we use OOUI. Pre-OOUI (you can checkout this state via git checkout 616ad5c), this js watches for changes in the min/max values and generates enough labels for the entire range dynamically:

image.png (238×901 px, 19 KB)

(incidentally, this means that there appears to be no no-js support for this 👇 )

image.png (279×1 px, 22 KB)

@Tchanders should we split this up into 2 tickets? One for js support (ie. update this JS to recognize the changing input and use OOUI widgets) and one for no-js support? I'm not sure how no-js support would look yet since the number of column labels depends on the user's inputed range.

Fixed up the columns appearing for this ticket but left the inputs as-is for work in another ticket (T273043: Update custom column label inputs to use OOUI widgets)

Change 658950 had a related patch set uploaded (by STran; owner: STran):
[mediawiki/extensions/SecurePoll@master] Fix change handlers for custom columns in range voting

https://gerrit.wikimedia.org/r/658950

Change 658950 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] Fix change handlers for custom columns in range voting

https://gerrit.wikimedia.org/r/658950

I can no longer reproduce this bug.

Test Environment: https://vote.wikimedia.beta.wmflabs.org SecurePoll 2.0.0 (3534347) 07:48, 1 February 2021.