Last modified: 2014-09-20 18:33:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72814, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70814 - BetaFeatures: Warnings about allowed skins are not displayed
BetaFeatures: Warnings about allowed skins are not displayed
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
BetaFeatures (Other open bugs)
master
All All
: Normal normal (vote)
: ---
Assigned To: Seb35
https://www.mediawiki.org/wiki/Specia...
:
Depends on:
Blocks: 69823
  Show dependency treegraph
 
Reported: 2014-09-13 13:45 UTC by Seb35
Modified: 2014-09-20 18:33 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Seb35 2014-09-13 13:45:46 UTC
The list of allowed skins of the BetaFeatures extension (in $prefs[$key]['requirements']['skins']) is not displayed in the HTML code.
Comment 1 Seb35 2014-09-13 13:46:53 UTC
The problem comes from BetaFeaturesHooks::getPreferences, in the code

  $prefs[$key]['requirements']['skins'] = array_intersect( $prefs[$key]['requirements']['skins'], Skin::getAllowedSkins() );

because Skin::getAllowedSkins() is an array key-value and we want the key and not the value, so it should be used array_keys( Skin::getAllowedSkins() ).

I prepare the patch.
Comment 2 Gerrit Notification Bot 2014-09-13 13:57:58 UTC
Change 160213 had a related patch set uploaded by Seb35:
Display the required skins

https://gerrit.wikimedia.org/r/160213
Comment 3 Seb35 2014-09-13 14:10:40 UTC
The current state on the Wikimedia project is without the names of the required skins. In the case it is wanted to keep the current state (for Wikimedia and/or for the master branch of BetaFeatures), this feature can be hidden with CSS, similarly to the browser requirements, by editing BetaFeatures/resources/betafeatures.less.
Comment 4 Bartosz Dziewoński 2014-09-18 20:56:52 UTC
Fixing this bug will result in big red warnings being displayed under most BetaFeatures. The warnings also mention the hidden Minerva skin (e.g. for VisualEditor). Furthermore, they override the warnings about JavaScript being required.

The bug is real and the fix is correct, but I'm pretty sure people started relying on the bug being a feature, and fixing this brings out a few more bugs. The existing beta features need be reviewed in context of this first, and I have no idea who's going to do it. :/
Comment 5 Seb35 2014-09-18 22:47:02 UTC
Thanks for your comment, I didn’t paid attention to the JS warning who disappeared, but by further investigating:
1/ it is a feature to hide the warning "JS is required" when JS is enabled (see resources/betafeatures.js, there is the comment "We're here so JavaScript works"), and
2/ it was previously displayed because no skins were found in BetaFeaturesHooks::getPreferences (there are warnings in the debug log "[BetaFeatures] The visualeditor-enable BetaFeature has no valid skins installed."), which results not to add these beta features in the wgBetaFeaturesFeatures JS variables, which results betafeatures.js don’t loop into these beta features and don’t hide the JS warning (and don’t test if the browser is supported).

So the bug is deeper I first thought, and I find it worth fixing it. But I aggree the skins requirements are not necessary and it is a change from the current behaviour, so I hide them in the LESS file (to keep consistency with current behaviour).
Comment 6 Gerrit Notification Bot 2014-09-19 21:24:25 UTC
Change 160213 merged by jenkins-bot:
Display the required skins

https://gerrit.wikimedia.org/r/160213
Comment 7 Bartosz Dziewoński 2014-09-19 21:24:58 UTC
Hah, fascinating. Okay, let's do this then.

Should we mark this as resolved after merging the patch, or do you want to actually display this information?
Comment 8 James Forrester 2014-09-19 21:36:44 UTC
I'm… confused.

The purpose of the Beta Feature warning section is to inform you why enabling it won't be useful to you.

I.e.:

* if you don't have JS working, tell you if it needs JS;
* if you don't use Vector, tell you if it only works for that skin;
* if you don't have Internet Explorer, tell you if it only works in that browser.

If none of these are met (i.e., it should work), the warnings should not appear.

The title of this bug suggests that this is not understood.
Comment 9 Seb35 2014-09-19 23:28:01 UTC
Yes, I didn’t describe exactly the bug: the allowed skins were never displayed in the HTML, neither when the current skin is an allowed skin, neither when the current skin is not an allowed skin.

With the patch, the JS warning is now correctly triggered. When a blacklist is specified for a beta feature, it is always added in the HTML.

For the skin, you are right, it should be displayed only when the current skin is not allowed. See next patch.
Comment 10 Gerrit Notification Bot 2014-09-19 23:40:16 UTC
Change 161629 had a related patch set uploaded by Seb35:
Display allowed skins if and only if the current skin is not allowed

https://gerrit.wikimedia.org/r/161629
Comment 11 James Forrester 2014-09-19 23:48:00 UTC
(In reply to Seb35 from comment #9)
> Yes, I didn’t describe exactly the bug: the allowed skins were never
> displayed in the HTML, neither when the current skin is an allowed skin,
> neither when the current skin is not an allowed skin.
> 
> With the patch, the JS warning is now correctly triggered. When a blacklist
> is specified for a beta feature, it is always added in the HTML.
> 
> For the skin, you are right, it should be displayed only when the current
> skin is not allowed. See next patch.

This looks good, thank you. :-)
Comment 12 Gerrit Notification Bot 2014-09-20 17:13:07 UTC
Change 161629 merged by jenkins-bot:
Display allowed skins if and only if the current skin is not allowed

https://gerrit.wikimedia.org/r/161629
Comment 13 Bartosz Dziewoński 2014-09-20 17:13:07 UTC
Thank you!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links