# [Regression] MathJax broken in 1.23wmf22 and masterClosed, ResolvedPublicActions

Subscribers
Assigned To
None
Authored By
TheDJ, Apr 14 2014

# Description

MathJax is not working in 1.23wmf22 and later, incl master.
1.23wmf22 is currently deployed to group0 and will be deployed to group1 and group2 on tuesday and thursday respectively.

The breakage can be witnessed here:
https://test.wikipedia.org/wiki/MathTextPage

Problems:
1: There seems to be a change in how the mathjax setting is kept, but users do not appear to get migrated into the new setting. This is bound to create community friction.
2: In PNG mode, the mathjax option doesn't seem to work at all
3: in Tex mode on betalabs I get:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (MathZoom.js, line 0)

Suspected cause of breakage is Bug 57981, commit https://gerrit.wikimedia.org/r/#/c/110226/

Version: master
Severity: major

# Details

Reference
bz63915
bzimport set Reference to bz63915.
bzimport added a subscriber: Unknown Object (MLST).

physik wrote:

thanks for bringing that up.
To the problems:

1. The new and the old setting are technically a completly different thing. I was thinkint that MathJax is an experimental option and only few people are using that. Would you vote for a migration script?
1. After adding action=purge to the page everything worked well.

3)seems to work for me as well.

1. if we can grandfather people in, then we should (if mathjax -> source + mathjax).
2. If we need to purge every page that contains math, then that seems problematic to me, or at the very least requiring coordination with ops. Is the problem that the module required is not in the page, or is that the required classes are not in the tag of the content ?
3. Still have those errors (Safari 7, labs only), which to mean indicates that something in the resource loader order is going wrong.

physik wrote:

1. is there a template for such a maintenance script (that only needs to be run once)
2. that's a fundamental problem. if we change the program we also have to renew the caches. But I think it's one of last changes to the png rendering mode. Also it affects people that use png+mathjax only (currently nobody)
3. did this error occour before the change as well?

physik wrote:

*** Bug 64097 has been marked as a duplicate of this bug. ***

physik wrote:

Any ideas for a maintenance script that updates the users settings?

There is maintenance/userOptions.php, but it's rather limited.

physik wrote:

1. With the help of user Salix alba I found out that

#### MathJax

renders as

maybe mathjax does not like elements with id MathJax

physik wrote:

(In reply to Bartosz Dziewoński from comment #8)

There is maintenance/userOptions.php, but it's rather limited.

/** @var boolean $wgDefaultUserOptions['mathJax'] determines if client-side mathjax is enabled by default */$wgDefaultUserOptions['mathJax'] = false;

the Option mathJax gets visible to the script.
With the script it would be possible to change the user options from mathjax to source. But not to enable the mathJax option

Add default value for user option mathJax

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

(In reply to physikerwelt from comment #9)

1. With the help of user Salix alba I found out that === MathJax === renders as <h3><span class="mw-headline" id="MathJax">MathJax</span></h3>

maybe mathjax does not like elements with id MathJax

That shouldn't cause any problems for MathJax. MathJax uses MathJax-Element-N ids.

In Hebrew Wikipedia there is a script for live preview of math equation in toolbar using MathJax, and after the last changes it doesn't work.

The first problem, which I can workaround is that MathJax ignores loading when user didn't allow MathJax in their preferences. [can be hacked by mw.user.options.set( 'mathJax', true); before explicit loading of ext.math.mathjax.enabler ]

But it doesn't solve it yet, and I'm not sure why, as MathJax is loaded correctly. The source is in mathDialog function in:
https://he.wikipedia.org/wiki/MediaWiki:Edittoolbar.js

Can you please explain how should we use MathJax modules after the last changes?

Add default value for user option mathJax

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

Can only MatmaRex review this, or do you have other reviewers in mind?
Would love to see this getting merged...

physik wrote:

My impression is that reviews happen just occassionaly. The coding of Math2.0 was finished at 5th of October 2013. Only a fraction has been reviewed yet.
It would really help if the foundation could assign some reviewers to have a look at all the changes.
This individual commit is just a tiny step into the right direction and won't change anything fundamental.
@Eran: What are your settings in the user page. The checkbox for MathJax must be checked. If there is no checkbox probably $wgUseMathJax is not set to true. bzimport added a comment. physik wrote: PS: An overview paper over the changes is availible at http://arxiv.org/abs/1404.6179 gerritbot added a comment. Change 127607 merged by jenkins-bot: Add default value for user option mathJax https://gerrit.wikimedia.org/r/127607 eranroz added a comment. @Physikerwelt: it is not related to user setting - the script overrides the user settings. mw.user.options.set( 'mathJax', true);//override user settings mw.loader.using(['jquery.ui.dialog','ext.math.mathjax.enabler'],function(){  var mathEditor=$('<div>');
var mathInput=$('<input>',{dir:'ltr'}).appendTo(mathEditor); var mathPreview=$('<div>').appendTo(mathEditor);
mathEditor.dialog({title: 'Math editor', buttons: {
'Insert': function(){
$("#wpTextbox1").textSelection('encapsulateSelection', {replace: true, peri: '$'+mathInput.val()+'$'});$(this).dialog('close');
}
} });
mathInput.keyup(function(){
mathPreview.html('<span dir="ltr" class="tex">$'+$(this).val()+' $</span>'); MathJax.Hub.Queue( ["Typeset", MathJax.Hub, mathPreview.get(0)]) }); var selection =$("#wpTextbox1").textSelection( 'getSelection' );
//insert the selected text into the equation editor
var mathRgx=/[itex](.*)<\/math>/;
if(selection && mathRgx.test(selection)){
mathInput.val(mathRgx.exec(selection)[1]);
mathInput.keyup();
}

});

This bug hasn't been touched in 2+ months. Is this still an issue?

A user wrote in [[ticket:2014070210002455]] ~17 hours ago:

I usually have MathJax enabled in my preferences. Today I noticed that it
causes equations to just display "Math Processing Error”, rather than the
equation. Happens on both Firefox and Chrome.

physik wrote:

I think the issue has been resolved.

physik wrote:

OK. It's still disabled via config.
And there is not yet any mathoid instance for production to the SVG generation will not work even though the required database tables have been created.
Currently the MathJax team is working on a phantomjs less method to render texvc to mathml and svg. Yesterday I have tested that it works quite well. I would appreciate a discussion with ops that to figure out how this can be can go to production. The original idea was to use jenkins to build the mathoid debian package. Even though the debian package builds without any issues in the launchpad ppa repo jenkins can not build the package. If there is a reference project that uses jenkins to build debian packages that go to production this would really help to figure out what is different for mathoid.

(In reply to physikerwelt from comment #21)

I
would appreciate a discussion with ops that to figure out how this can be
can go to production.

Can you start a thread on wikitech-l regarding this, please? That'll get involvement from the relevant people.

[Resetting bug status as there are no known patches left to review]

(In reply to Greg Grossmeier from comment #22)

Can you start a thread on wikitech-l regarding this, please? That'll get
involvement from the relevant people.

physikerwelt: Did you have time to contact wikitech-l yet?

physik wrote:

no, I got a hint that there might be a related rt ticket which I wanted to take into account for the wikitech-l thread
https://rt.wikimedia.org/Ticket/Display.html?id=6077
but I did not manage to access it.

physik wrote:

I'm quite good in posting to wikitech-l without to get any feedback...
http://lists.wikimedia.org/pipermail/wikitech-l/2014-July/077422.html
I have the feeling that everybody thinks that there must be someone else who feels responsible for the Math extension related stuff.
From a software design perspective it was an excellent idea to move the math extension away from core. From a social perspective it was not.
Whenever I commit something to master I got feedback within 10 minutes or so.
For the Math extension this situation is quite different.

physikerwelt, we reset your RT password as requested but to let you see the ticket it either needs to be moved into the (more public) queue "ops-requests" within RT or you need to be added to the "volunteers" group in RT (which requires https://wikitech.wikimedia.org/wiki/Volunteer_NDA). I updated the ticket to say that as well...

(In reply to Daniel Zahn from comment #26)

midair collision...

AFAIK, physikerwelt should already have a copy of everything on the ticket in his inbox. (unless some mail got lost along the way) Already moved to ops-requests for now.

physik wrote:

Thank you. Now everything works fine.

physik wrote:

According to the original bug description nothing is broken now.
The RT is about enabling Mathoid that outputs MathML and SVG-fallback.

(In reply to physikerwelt from comment #29)
does that mean something changed server-side since comment 21? (what to do now with comment 19? can someone reproduce that?)

also, what about the discussion you wanted to have with ops? Greg and I had an earlier midair collision. I think wikitech-l and the existing ticket are both fine places to outline whatever you want to discuss but it then may end up getting moved somewhere else. (a different list or a ticket or a new bug, etc.)