Page MenuHomePhabricator

FCKeditor doesn't work in the latest version of MW with any RTL installation
Closed, ResolvedPublic

Description

Author: gregra

Description:
There seems to be a JavaScript problem with this version that concerns the localization to Hebrew (and maybe other languages too). When I change $wgLanguageCode to En, it works perfectly but as soon as I change back to Hebrew the editor couldn't load. I also get on my firebug these JS errors:

<pre>
unterminated string literal
ss/fckeditor-rtl.css";\n

showFCKEditor is not defined
if( showFCKEditor & ( RTE_POPUP|RTE_TOGGLE_LINK ) ){
</pre>

To see the bug, go to my wiki (as I mentioned in the URL) - and <a href='http://wikidemo.willki.com/heb16/index.php?title=%D7%A2%D7%9E%D7%95%D7%93_%D7%A8%D7%90%D7%A9%D7%99&action=edit'>edit</a>.


Version: unspecified
Severity: major
URL: http://wikidemo.willki.com/heb16

Details

Reference
bz25653

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:15 PM
bzimport set Reference to bz25653.
bzimport added a subscriber: Unknown Object (MLST).

gregra wrote:

(In reply to comment #0)

There seems to be a JavaScript problem with this version that concerns the
localization to Hebrew (and maybe other languages too). When I change
$wgLanguageCode to En, it works perfectly but as soon as I change back to
Hebrew the editor couldn't load. I also get on my firebug these JS errors:

<pre>
unterminated string literal
ss/fckeditor-rtl.css";\n

showFCKEditor is not defined
if( showFCKEditor & ( RTE_POPUP|RTE_TOGGLE_LINK ) ){
</pre>

To see the bug, go to my wiki (as I mentioned in the URL) - and <a
href='http://wikidemo.willki.com/heb16/index.php?title=%D7%A2%D7%9E%D7%95%D7%93_%D7%A8%D7%90%D7%A9%D7%99&action=edit'>edit</a>.

OK, got it working.
One of the JS lines was buggy.
To fix it, change line 418 in extensions/FCKeditor/FCKeditor.body.php from

$script .= 'oFCKeditor.Config["EditorAreaCSS"] = wgScriptPath + "/" + wgFCKEditorExtDir + "/css/fckeditor.css, wgScriptPath + "/" + wgFCKEditorExtDir + "/css/fckeditor-rtl.css";';

to

$script .= 'oFCKeditor.Config["EditorAreaCSS"] = wgScriptPath + "/" + wgFCKEditorExtDir + "/css/fckeditor.css" + wgScriptPath + "/" + wgFCKEditorExtDir + "/css/fckeditor-rtl.css";';

asmodai wrote:

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

asmodai wrote:

This is not in the repository yet, so do not mark it as resolved fixed.

asmodai wrote:

Patch to the latest r78294 based on text in the ticket

Attached:

gusschlaien wrote:

Just amazing, worked like a charm!!!! Thanks Gregory

dragon wrote:

The above patch does not properly fix the problem.

Although it solves the 'unterminated string' error, the changed line is still incorrect. The result is that although FCKeditor will now 'load', the style sheets are still not loaded and style formatting is absent from the editor.

I've created a diff against the diff above that properly solves the problem.
http://www.mediawiki.org/wiki/Extension_talk:FCKeditor_(Official)#Extension_doesn.27t_work_with_RTL_languages_.28exists_in_1.16-r69707_and_trunk-r87608.29_SOLVED

In short, there needs to be a commma between the location of the two style sheets.

de-blocking from 26676, this is a extension so its not blocking the 1.17 release.

-need-review +reviewd. patch has been applied.

(In reply to comment #9)

-need-review +reviewd. patch has been applied.

Could you post the revision number and re-close the bug?

(In reply to comment #10)

(In reply to comment #9)

-need-review +reviewd. patch has been applied.

Could you post the revision number and re-close the bug?

(In reply to comment #5)

See r82145

its been reopened since then, so no i'm not closing.

(In reply to comment #7)

In short, there needs to be a commma between the location of the two style
sheets.

And the quotes need to be closed. Who was the idiot who did that?

(In reply to comment #5)

See r82145

Oh. /me tries to hide himself.

r87957