Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wysiwyg does not work with MW1.26.xx (fix available in branch wysiwyg_mw126_rsl) #81

Closed
riparap opened this issue Feb 19, 2016 · 12 comments

Comments

@riparap
Copy link
Contributor

riparap commented Feb 19, 2016

Could it be that the main reason to problems of wysiwyg with MW 1.26.x is this:
BREAKING CHANGE: mediawiki.legacy.ajax has been removed, following a lengthy deprecation period (see details here). There seems to be ajax related calls in programs of wysiwyg. If this is the problem, does anybody have any idea how this could be fixed? .... this page has some related information. Or am I on wrong tracks here?

@riparap
Copy link
Contributor Author

riparap commented Feb 20, 2016

There are two problems:
A. Calls like 'sajax_do_call' will not work anymore. They have to be replaced, $.post( mw.util.wikiScript(), { action: 'ajax', .... seems to work, but I have problems with returned format of data. It seems to be plain text, because result.responseText will not work. Is there a way to define format in call?

B. Problem when wiki page is reopened in wysiwyg, see #82

@ricordisamoa
Copy link

From an outside perspective, this extension's tech debt seems to have piled up in a very dramatic way. Just my 2 cents.

@riparap
Copy link
Contributor Author

riparap commented Feb 25, 2016

Could you point out what these tech debts are and if possible the preferable way to fix them ?

It will most likely be so that I do not have enough expertese to fix them all but to get a list of them would be at least a good start point.

@ricordisamoa
Copy link

You need someone who is experienced with both MW and this extension.

@riparap
Copy link
Contributor Author

riparap commented Mar 26, 2016

Seems that there are not so many that kind of persons available or then they are just silent or do not want to share they knowledge :) .... I had to try to study this myself and seems like I was able to fix this. I am not sure if I did everything by the book because once again this was done more by trial and error than clear vision about the solution... few beers also helped me at most desperate times :). Pile of tech debt with this extension is not so huge anymore I hope.

There are still some style information injected into page directly without resourceloader because I could not figure out how resourceloader could be used, because styles seems to be somehow user specific.

Branch wysiwyg_mw126_rsl contains latest modification for wysiwyg using MW1.26 and resourceloader (Version 1.5.6_0 [B551+26.03.2016]).

@riparap riparap changed the title Wysiwyg does not work with MW1.26.xx Wysiwyg does not work with MW1.26.xx (fix available in branch wysiwyg_mw126_rsl) Mar 26, 2016
@riparap
Copy link
Contributor Author

riparap commented Apr 17, 2016

Source- mode of CKeditor works (branch wysiwyg_mw126_rsl, Version 1.5.6_0 [B551+17.04.2016]), but so far I have been unable to make it work using resourceloader. Workaround requires usage of variables
$wgWYSIWYGSourceMode = true and $wgResourceLoaderDebug = true in LocalSettings.php.

@ltuo
Copy link

ltuo commented Jun 3, 2016

Installed this branch on MediaWiki 1.26.2 and enabled it in LocalSettings.php. MediaWiki failed to start and there is a message in httpd/error.log as below:
[Fri Jun 03 15:25:34 2016] [error] [client a.b.c.d] PHP Parse error: syntax error, unexpected '[' in /var/www/html/mediawiki-1.26.2/extensions/WYSIWYG/CKeditor.body.php on line 628.

Line 628: 'fck_mv_plg_strtr_span' => [], //16.01.15 RL

Added '' to enclose [] for workaround temporarily:
'fck_mv_plg_strtr_span' => '[]', //16.01.15 RL

It works but I don't know if this is the right fix.

@riparap
Copy link
Contributor Author

riparap commented Jun 3, 2016

Thanks for posting the solution. I think single quotes is the right way to fix it.

@ricordisamoa
Copy link

[] (short array syntax) is the same as array() but only since PHP 5.4.

@riparap
Copy link
Contributor Author

riparap commented Jun 3, 2016

Related php code is creating javascript varibles using MW function

 $wgOut->addJsConfigVars ( array(
....
'fck_mv_plg_strtr_span' => '[]',
....
)

Variable fck_mv_plg_strtr_span should be array in javascript... so how should this be fixed?

@ricordisamoa
Copy link

It seems that fck_mv_plg_strtr_span is already set to empty array in a JavaScript file... otherwise the old array syntax should work with PHP 5.3.

$wgOut->addJsConfigVars ( array(
....
'fck_mv_plg_strtr_span' => array(),
....
) );

@riparap
Copy link
Contributor Author

riparap commented Jun 4, 2016

Thanks, I have included this in Version 1.5.6_0 [B551+04.06.2016].

@riparap riparap closed this as completed Jul 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants