Page MenuHomePhabricator

Preview broken on thread reply posting/edit (Uncaught Exception in JavaScript)
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Go to https://translatewiki.net/wiki/User_talk:SiebrandLqtTest , choose one reply.
  2. More > Edit > show preview (by clinking or accesskey).
  3. No preview is shown and the page is centred on the "Subject" anchor.

Probably related to bug 39773?


Version: master
Severity: normal

Details

Reference
bz40083

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:10 AM
bzimport set Reference to bz40083.

This is because "doLivePreview" is not defined on Translatewiki.net (I'm not sure why).

BTW: I noticed there is no window.wg*** variables except "window.wgWikiEditorIconVersion" available on Translatewiki. They are only acessible through mw.config (e.g.: mw.config.get('wgServer')). Maybe there was some configuration change which cleared the window object (removing also the doLivePreview which is used by LQT).

(In reply to comment #1)

This is because "doLivePreview" is not defined on Translatewiki.net (I'm not
sure why).

BTW: I noticed there is no window.wg*** variables except
"window.wgWikiEditorIconVersion" available on Translatewiki. They are only
acessible through mw.config (e.g.: mw.config.get('wgServer')). Maybe there was
some configuration change which cleared the window object (removing also the
doLivePreview which is used by LQT).

You can find out why yourself on: https://gerrit.wikimedia.org/r/gitweb?p=translatewiki.git;a=tree
Cc Niklas anyway.

Whoops, I may have broken it in gerrit change I57e2fc0b, changing "window.doLivePreview = function..." to "var doLivePreview = function...".

Also, LivePreview since recently depends on jquery.form (gerrit change Ifcc7e7c5). This seems to also be causing problems (or maybe it's the real issue, as I've only gotten an error related to formToArray() being undefined when testing).

(In reply to comment #2)

You can find out why yourself on:
https://gerrit.wikimedia.org/r/gitweb?p=translatewiki.git;a=tree
Cc Niklas anyway.

The [[Manual:$wgLegacyJavaScriptGlobals]] is set to false on TranslatewikiSettings.php since it was created on gerrit change Ib9444cab.

(In reply to comment #3)

Whoops, I may have broken it in gerrit change I57e2fc0b, changing
"window.doLivePreview = function..." to "var doLivePreview = function...".

Also, LivePreview since recently depends on jquery.form (gerrit change
Ifcc7e7c5). This seems to also be causing problems (or maybe it's the real
issue, as I've only gotten an error related to formToArray() being undefined
when testing).

I'm getting
Uncaught TypeError: Object [object Object] has no method 'formToArray'
when I try to preview a comment on Portuguese Wikibooks.

This is partially fixed now - with this patch merged, the preview at least works, but no AJAX. This patch needs merging too: https://gerrit.wikimedia.org/r/#/c/23862/

Merged in masters of core and LiquidTreads, backported to wmf12, deployed.

Thanks for the fix. Though it would be nice if someone actually cared about the bugs we report from translatewiki.net before they hit production in wmf cluster.