Last modified: 2014-06-12 21:50:46 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 T66844, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64844 - Duplicate MathJax preference
Duplicate MathJax preference
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
REL1_23-branch
All All
: Unprioritized normal (vote)
: ---
Assigned To: physikerwelt
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-04 19:13 UTC by Richard Morris
Modified: 2014-06-12 21:50 UTC (History)
2 users (show)

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


Attachments

Description Richard Morris 2014-05-04 19:13:08 UTC
I've been installing a local copy of MediaWiki with the Math extension and MathJax enabled. Looking at the preferences Special:Preferences#mw-prefsection-rendering the MathJax option appears twice: once as radio button and once as a check box.

I've a clean install using 
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Math.git
and a git clone of the latest mediawiki.

my LocalSettings.php is pretty much copied direct from https://www.mediawiki.org/wiki/Extension:Math

require_once( "$IP/extensions/Math/Math.php" );
// Set this if you don't use MediaWiki Math's texvc:
// $wgTexvc =  '/your/path/to/texvc';

// Be sure to have a math directory with writing
// permission and that these two variables are set or
// default to that directory:
$wgMathDirectory = $wgScriptPath . '/mathCache';
$wgMathPath = 'http://localhost/~rich/mediawiki/mathCache';

$wgMathValidModes[] = MW_MATH_MATHJAX; // adding MathJax as rendering option
// or
//$wgMathValidModes = array( MW_MATH_MATHJAX ); // setting MathJax as only rendering option (optional)

$wgUseMathJax = true; // enabeling MathJax as rendering option
$wgDefaultUserOptions['mathJax'] = true; // setting MathJax as default rendering option (optional)

I think this may relate to
https://gerrit.wikimedia.org/r/#/c/127607/

Also if I change the rendering options to
//$wgMathValidModes[] = MW_MATH_MATHJAX; // adding MathJax as rendering option
// or
$wgMathValidModes = array( MW_MATH_MATHJAX ); // setting MathJax as only rendering option (optional)

I get [b768f98f] 2014-05-04 19:11:43: Fatal exception of type MWException when trying to view my preferences
Comment 1 physikerwelt 2014-05-04 19:50:07 UTC
You don't need to add  MW_MATH_MATHJAX to the $wgMathValidModes[] array.
The documentation might be outdated.
The Math extension in the master branch is currently between versions 1.1 and 2.0. 
It would be great to get code review for the last changes to get version 2.0 live.   After that documentation needs to be updated and new developments can base on the master branch with version 2.0.
Comment 2 Richard Morris 2014-05-04 21:07:37 UTC
Yes I see. Just getting my head round git and versions. Hopefully I get to look at  the math2_0_0 branch. I've just checked it out and rerun the update script. Special:Version is still reporting the version as 1.1. I think this is something in Math.php. (Actually an earlier version than master which is 1.2.)

I guess this bug can be closed or maybe repurpose as a documentation bug.
Comment 3 Richard Morris 2014-05-04 22:34:30 UTC
Ah I think I got the wrong branch. Is it the origin/dev for the 2.0 version? Its not at all clear from https://www.mediawiki.org/wiki/Extension:Math how to get the  2.0 version. 

With origin/dev  both 

$wgMathValidModes[] = MW_MATH_MATHJAX; // adding MathJax as rendering option

and 

$wgMathValidModes = array( MW_MATH_MATHJAX ); // setting MathJax as only 

give Fatal exception and I have to comment them both out.
Comment 4 physikerwelt 2014-05-05 06:04:06 UTC
I think the documentation was wrong. I fixed it on
https://www.mediawiki.org/wiki/Extension:Math

The second option should work with master and dev.
Sorry for the inconvenience.
Comment 5 physikerwelt 2014-05-05 06:22:20 UTC
i.e. the setting should be
$wgMathValidModes = array( MW_MATH_MATHSOURCE ); // setting Source as only serverside output
Comment 6 Richard Morris 2014-05-05 07:28:28 UTC
I get an exception for 

$wgMathValidModes = array( MW_MATH_MATHSOURCE );

I think it should be 

$wgMathValidModes = array( MW_MATH_SOURCE );

as that matches Math.hooks.php getMathNames(). That cures one error using a defined name but creates another error with 

[35c6258e] /~rich/mediawiki/index.php/Special:Preferences Exception from line 134 of /Users/rich/Sites/mediawiki/includes/Preferences.php: Global default '5' is invalid for field math

I think 5 is the numeric value of MW_MATH_MATHML and Math.php has a default

$wgDefaultUserOptions['math'] = MW_MATH_MATHML;

so its can't find the default in the array. I've now got

$wgMathValidModes[] = MW_MATH_SOURCE;

which works, but I don't think its needed at all as its already defined in Math.php

$wgMathValidModes = array( MW_MATH_PNG, MW_MATH_SOURCE, MW_MATH_MATHML );
Comment 7 physikerwelt 2014-05-05 08:19:04 UTC
Yes you are right.
I have insufficents rights to change Math extension page
https://www.mediawiki.org/w/index.php?title=Extension:Math&oldid=944056&diff=cur

I'll commit a patch that checks for invalid default values.
Comment 8 Gerrit Notification Bot 2014-05-05 09:42:51 UTC
Change 131439 had a related patch set uploaded by Physikerwelt:
Catch misconfiguration of math default option

https://gerrit.wikimedia.org/r/131439
Comment 9 Gerrit Notification Bot 2014-05-06 13:43:53 UTC
Change 131439 merged by jenkins-bot:
Catch misconfiguration of math default option

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

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


Navigation
Links