Last modified: 2014-09-20 18:15:43 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 T73088, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71088 - BetaFeatures: the VisualEditor section appears before the introduction
BetaFeatures: the VisualEditor section appears before the introduction
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
BetaFeatures (Other open bugs)
master
All All
: Low minor (vote)
: ---
Assigned To: Seb35
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-20 16:16 UTC by Seb35
Modified: 2014-09-20 18:15 UTC (History)
5 users (show)

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


Attachments
The VisualEditor section of BetaFeatures appears before the introduction (96.05 KB, image/png)
2014-09-20 16:16 UTC, Seb35
Details

Description Seb35 2014-09-20 16:16:46 UTC
Created attachment 16526 [details]
The VisualEditor section of BetaFeatures appears before the introduction

In my experimental setup, the VisualEditor section in the beta features appears as first item, just before the introductory text about beta features.

It appears that in the LocalSettings.php I load the VisualEditor extension before the BetaFeatures extension, and exchange the order results in a good placement of the VE as BF (normal order).
Comment 1 Seb35 2014-09-20 16:47:26 UTC
Since the VisualEditor registers its preference 'visualeditor-enable' in the standard GetPreferences and in the BF’s GetBetaFeaturePreferences, one is be cancelled.

If BF is loaded before VE (and hence BF’s GetPreferences is before VE’s GetPreferences), VE takes care and don’t add again the 'visualeditor-enable'.

But if VE is loaded before BF, VE’s GetPreferences first adds its 'visualeditor-enable' then VE’s GetBetaFeaturePreferences erases the previous value and remplaces it by the 'visualeditor-emable' in the BF syntax, but by *keeping* the same place in the $prefs array, so the PreferencesForm loads it in a "wrong" order.

Two non-exclusive solutions:
1. in BF, unset the $prefs[$key] before adding it, to restart the order (tested, it works)
2. in VE in onGetPreferences function, add a second condition before adding the 'visualeditor-enable' preference "!AutoLoader::loadClass( 'BetaFeatures' )" (tested, it works)
Comment 2 Bartosz Dziewoński 2014-09-20 17:00:36 UTC
Yeah. VE should just check for the presence of 'BetaFeatures' class, instead of relying on the order. You can just use class_exists() for that. Want to submit a patch?
Comment 3 Gerrit Notification Bot 2014-09-20 17:06:37 UTC
Change 161677 had a related patch set uploaded by Seb35:
Unset the preference key before adding it

https://gerrit.wikimedia.org/r/161677
Comment 4 Bartosz Dziewoński 2014-09-20 17:36:22 UTC
Oh, I misread your solution 1. That also makes sense. Thanks for the patch!
Comment 5 Gerrit Notification Bot 2014-09-20 17:38:23 UTC
Change 161677 merged by jenkins-bot:
Unset the preference key before adding it

https://gerrit.wikimedia.org/r/161677
Comment 6 Gerrit Notification Bot 2014-09-20 17:53:01 UTC
Change 161685 had a related patch set uploaded by Seb35:
Check the existence of BetaFeatures before adding the 'visualeditor-enable' preference

https://gerrit.wikimedia.org/r/161685
Comment 7 Seb35 2014-09-20 17:55:14 UTC
Thanks for merging, Bartosz.

I propose a patch for the second solution also, I find it better to check the existence of BetaFeatures.
Comment 8 Gerrit Notification Bot 2014-09-20 18:12:25 UTC
Change 161685 merged by jenkins-bot:
Check the existence of BetaFeatures before adding the 'visualeditor-enable' preference

https://gerrit.wikimedia.org/r/161685
Comment 9 Seb35 2014-09-20 18:15:43 UTC
Re-close. Thanks!

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


Navigation
Links