Page MenuHomePhabricator

Default to ON for (proofreadpage-showheaders) @ enwikisource
Closed, ResolvedPublic

Description

The recent upgrade to 1.20wmf has added to the Editing tab, what some wikisources had as a gadget, primarily the ability to set a toggle display header.

At English Wikisource, the gadget was set to be on by default, and the new option is off by default. Would the local settings for enwikisource please be updated to now have this gadget on.


Version: wmf-deployment
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=34942
https://bugzilla.wikimedia.org/show_bug.cgi?id=36141

Details

Reference
bz36094

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:23 AM
bzimport set Reference to bz36094.
bzimport added a subscriber: Unknown Object (MLST).

That preference doesn't exist in trunk

(In reply to comment #1)

That preference doesn't exist in trunk

It's in an extension (cf. https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114004). At what point was Wikimedia's git branch for this extension created?

And more generally, I'm not sure how user prefs are set from an extension. Do you use https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions or some other method?

Link to a see also in bugzilla

Also, to link to where the preference used to sit within enWS
https://en.wikisource.org/w/index.php?title=MediaWiki:Gadget-pr_headers.js

(In reply to comment #2)

(In reply to comment #1)

That preference doesn't exist in trunk

It's in an extension (cf.
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114004). At what point
was Wikimedia's git branch for this extension created?

And more generally, I'm not sure how user prefs are set from an extension. Do
you use https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions or some
other method?

So it looks like r114004 got reverted by r114398. Then the Git migration happened. Then Reedy moved the JS to the modules directory in this rev: https://gerrit.wikimedia.org/r/6340. That's where they are now.

Looking at https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/ProofreadPage.git;a=blob;f=modules/ext.proofreadpage.page/ext.proofreadpage.page.js;h=8de9532b7e9e8813211ca076ae20efdbdba05b03;hb=a86dd67fbecea2078cc81badd8222ed05499f876 and https://bits.wikimedia.org/en.wikisource.org/load.php?debug=true&lang=en&modules=ext.proofreadpage.page&only=scripts&skin=monobook&*, we can see that the following code is present currently:


		if ( mw.user.options.get( 'proofreadpage-showheaders' ) ) {
			pr_reset_size();
		} else {
			pr_toggle_visibility();
		}

So this bug is largely invalid. Local Wikisource administrators should continue to use Common.js or a user JavaScript gadget (preferably a gadget) to override this on a site-wide or per-user basis. If/when the code from r114004 is pulled into Git, this bug can be re-opened or a new bug can be filed.

(In reply to comment #4)

(In reply to comment #2)

(In reply to comment #1)

That preference doesn't exist in trunk

It's in an extension (cf.
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114004). At what point
was Wikimedia's git branch for this extension created?

And more generally, I'm not sure how user prefs are set from an extension. Do
you use https://www.mediawiki.org/wiki/Manual:$wgDefaultUserOptions or some
other method?

So it looks like r114004 got reverted by r114398. Then the Git migration
happened. Then Reedy moved the JS to the modules directory in this rev:
https://gerrit.wikimedia.org/r/6340. That's where they are now.

Okay, just kidding. While r114398 reverted r114004, Roan remerged the code in https://gerrit.wikimedia.org/r/3466.

The preference can be viewed here: https://en.wikisource.org/wiki/Special:Preferences#mw-prefsection-editing. It reads "Show header and footer fields...". The current default is OFF. The English Wikisource would like for the default to be ON.

So for Reedy, the question is: how is a default user option from an extension like this set and can it be switched for the English Wikisource?

(It may also be worth considering whether the extension's default to "off" is wise, but that's really a separate bug.)

Re-opening for now.

elseif ( $wgDBname == 'enwikisource' || $wgDBname == 'svwikisource' ) {
$wgDefaultUserOptions['proofreadpage-showheaders'] = 1;
}

Looks fixed to me, thanks Reedy!

Generally an array of wiki databases or some kind of configuration variable would better here, as I imagine other Wikisourcen are going to request this type of thing, but that can be implemented later.

Checked on spare account and functioning for me.