Page MenuHomePhabricator

When you set the local exception for an option the label text still appears disabled
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

On Special:Preferences, when you check the local exception for a global option the text label is greyed out like it were disabled.

This affects a lot of user preferences. I think mostly options with checkboxes.

Steps to reproduce problem
  1. Go to Special:GlobalPreferences
  2. Make "Allow other users to email me" global
  3. Go to Special:Preferences
  4. Check the local exception for "Allow other users to email me"

Expected behavior: The label "Allow other users to email me" is in the normal text colour
Observed behavior: The label is greyed out

Environment

Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.38.0-alpha (2682461) 07:22, 2 December 2021. GlobalPreferences 0.1.2 (e9ea9af) 05:41, 1 December 2021.

Screenshots (if applicable):

greyed_out_labels.png (355×798 px, 50 KB)

Event Timeline

This can be reproduced on production wikis, it seems that we should infuse the field layout and use $layout.fieldWidget.setDisabled() to set the state like what hide-if mechanism do. I'm here to mention https://gerrit.wikimedia.org/r/c/683142 again, which can fix this... Can someone promote the code review? Anyway, I can write a simple fix for this bug.

Change 743024 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/GlobalPreferences@master] Infuse the field layout instead of widgets, to set the state of labels properly

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

Oh, in that way we don't need either the special treat for checkMatrixWidget or the enumeration of dependencies!

This can be reproduced on production wikis, it seems that we should infuse the field layout and use $layout.fieldWidget.setDisabled() to set the state like what hide-if mechanism do. I'm here to mention https://gerrit.wikimedia.org/r/c/683142 again, which can fix this... Can someone promote the code review?

We have T272302 in our "Needs review" column and have prioritized it. Apologies for the long wait. We truly appreciate you volunteering your time!

We have T272302 in our "Needs review" column and have prioritized it. Apologies for the long wait. We truly appreciate you volunteering your time!

Thank you! In fact after this patch came out, my major concern to promote the 'disable-if' method has been dissolved a lot since we don't need to enumerate dependencies now.

Change 743024 merged by jenkins-bot:

[mediawiki/extensions/GlobalPreferences@master] Infuse the field layout instead of widgets, to set the state of labels properly

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