Last modified: 2014-08-25 07:59:29 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 T64362, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62362 - [Compact links] Don't show as a beta feature option if it can't be enabled
[Compact links] Don't show as a beta feature option if it can't be enabled
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UniversalLanguageSelector (Other open bugs)
master
All All
: High normal (vote)
: MW 1.24 version
Assigned To: Nemo
:
Depends on:
Blocks: 64793 hackathon2014
  Show dependency treegraph
 
Reported: 2014-03-07 07:32 UTC by Nemo
Modified: 2014-08-25 07:59 UTC (History)
10 users (show)

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


Attachments

Description Nemo 2014-03-07 07:32:44 UTC
1) Visit https://test.wikipedia.org/wiki/Main_Page
2) Go to https://test.wikipedia.org/wiki/Special:Preferences#mw-prefsection-betafeatures
3) Notice and check the option for "Compact language links"
4) Go back to the main page
I. Observed: Nothing changed.
II. Expected: I'm not offered the option if it doesn't have an effect.

Introduced by https://gerrit.wikimedia.org/r/#/c/117212/ , see also bug 62361.
Comment 1 Nemo 2014-03-07 07:35:52 UTC
https://gerrit.wikimedia.org/r/#/c/117366/ was approved and backported, but I still see the incorrect behaviour.
Comment 2 Niklas Laxström 2014-03-07 07:40:27 UTC
To clarify: the beta feature is offered, but the feature does nothing because of the differing checks for the preference and the actual feature.

Preference:
+               if ( $wgULSCompactLinks ) {
+                       $prefs['uls-compact-links'] = array(


Feature:
+               if ( $wgULSCompactLinks &&
+                       $wgULSPosition === 'interlanguage' &&
+                       class_exists( 'BetaFeatures' ) &&
                        BetaFeatures::isFeatureEnabled( $out->getUser(), 'uls-compact-links' )
                ) {
                        $out->addModules( 'ext.uls.compactlinks' );

(Test Wikipedia is one of those wikis which has ULS in personal position but also has interwiki links)
Comment 3 Gerrit Notification Bot 2014-03-07 09:45:28 UTC
Change 117394 had a related patch set uploaded by Niharika29:
Don't show compact-link beta feature in list if it cannot be enabled

https://gerrit.wikimedia.org/r/117394
Comment 4 Pau Giner 2014-03-07 09:49:16 UTC
The beta feature should not be listed on those wikis where activating it has no effect.

Currently the ULS position is used as a conservative way to make sure the feature only applies to wikis where we are sure interlanguage links exist.
We can also consider to base this logic on $wgInterwikiMagic $wgHideInterlanguageLinks instead to both list and activate the feature only on wikis with interlanguage links support.
Comment 5 Gerrit Notification Bot 2014-03-08 03:40:30 UTC
Change 117394 abandoned by Niharika29:
Don't show compact-link beta feature in list if it cannot be enabled

Reason:
Not needed.

https://gerrit.wikimedia.org/r/117394
Comment 6 Nemo 2014-03-08 09:08:55 UTC
(In reply to Gerrit Notification Bot from comment #5)
> Change 117394 abandoned by Niharika29:
> Don't show compact-link beta feature in list if it cannot be enabled
> 
> Reason:
> Not needed.

But the checks are still differing between preference and feature, as Niklas said.
Comment 7 Niharika 2014-03-08 09:49:34 UTC
Checks to show the feature in BFs list:
$wgULSCompactLinks && $wgInterwikiMagic == true && $wgHideInterlanguageLinks == false
This will ensure the feature is available on wikis which have interlanguage links irrespective of ULS position IFF $wgULSCompactLinks is true. 

Checks to load the module: 
$wgULSCompactLinks && class_exists( 'BetaFeatures' ) &&
BetaFeatures::isFeatureEnabled( $out->getUser(), 'uls-compact-links' )

We check the global flag in addition to checking whether the user has opted for the beta feature or not. This is important because if we don't check it here and the flag is turned false at some point of time, then the users will be stuck with the feature ON and will have no way to turn it OFF.

I hope that clears it up.
Comment 8 Nemo 2014-05-11 15:45:36 UTC
(In reply to Niklas Laxström from comment #2)
> To clarify: the beta feature is offered, but the feature does nothing
> because of the differing checks for the preference and the actual feature.

Now it is: A) adding the preference

		if ( $wgULSCompactLinks &&
			$wgInterwikiMagic === true &&
			$wgHideInterlanguageLinks === false
		) { ...

B) actually adding the feature

		if ( $wgULSCompactLinks &&
			class_exists( 'BetaFeatures' ) &&
			BetaFeatures::isFeatureEnabled( $out->getUser(), 'uls-compact-links' )
		) { ...

B can't be false unless A is also false (or invalid), but syncing the two would make the thing cleaner.
Comment 9 Gerrit Notification Bot 2014-05-11 15:50:07 UTC
Change 132819 had a related patch set uploaded by Nemo bis:
Compact links beta feature conditions sync

https://gerrit.wikimedia.org/r/132819
Comment 10 Gerrit Notification Bot 2014-08-25 07:51:39 UTC
Change 132819 merged by jenkins-bot:
Compact links beta feature conditions sync

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

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


Navigation
Links