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

MW 1.32 does not show the wysiwyg #122

Open
Yannick86 opened this issue May 29, 2019 · 15 comments
Open

MW 1.32 does not show the wysiwyg #122

Yannick86 opened this issue May 29, 2019 · 15 comments

Comments

@Yannick86
Copy link

Can anyone tell me how I can fix this? I have MW 1.32 and placed the 3 folders (WikiEditor, WYSIWYG & SemanticForms ) in the extensions folder.

I have also added the following in LocalSettings.php

#Default user options:
$wgDefaultUserOptions['riched_disable'] = false;
$wgDefaultUserOptions['riched_start_disabled'] = false;
$wgDefaultUserOptions['riched_use_toggle'] = true;
$wgDefaultUserOptions['riched_use_popup'] = false;
$wgDefaultUserOptions['riched_toggle_remember_state'] = true;
$wgDefaultUserOptions['riched_link_paste_text'] = true;

//MW<=1.24 or versions of WYSIWYG <= "1.5.6_0 [B551++01.07.2016]"
require_once "$IP/extensions/WYSIWYG/WYSIWYG.php";

//MW>=1.25 and versions of WYSIWYG >= "1.5.6_0 [B551+02.07.2016]"
wfLoadExtension( 'WYSIWYG' );

//MW>=1.25 and versions of WYSIWYG >= "1.5.6_0 [B551+02.07.2016]" has dependency
//to module of WikiEditor so it must be enabled too (or otherwise file
//extension.json has to be edited manually to remove dependency)
wfLoadExtension( 'WikiEditor' );

Still I don't see the CKeditor .. always the original WikiEditor .. no errors, nothing.

@Yannick86 Yannick86 changed the title WikiEditor being shown MW 1.32 does not show the wysiwyg May 29, 2019
@Guardiandota
Copy link

Same here. No errors no logs, Enabled in Version page, but not working

@usbport11
Copy link

usbport11 commented May 31, 2019

Hi all.

Delete original WikiEditor extension folder, download latest, copy it to extensions folder.

Download WYSIWIG extension, copy only WYSIWYG folder to extensions folder.

WYSIWYG/extension.json
delete in Hooks section
"LanguageGetMagic" : ["CKeditor_MediaWiki::onLanguageGetMagic"],
"LanguageGetMagic" : ["CKeditor_MediaWiki::onLanguageGetMagic"],

WYSIWYG/CKeditor.body.php
rem strings
near 113
//public static function onLanguageGetMagic( &$magicWords, $langCode ) {
//$magicWords['NORICHEDITOR'] = array( 0, 'NORICHEDITOR' );
//return true;
//}

near 119
//MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );

near 309
//MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );

LocalSettings.php
$wgGroupPermissions['*']['wysiwyg']=true;
$wgGroupPermissions['user']['wysiwyg']=true;
$wgDefaultUserOptions['riched_disable'] = false;
$wgDefaultUserOptions['riched_start_disabled'] = false;
$wgDefaultUserOptions['riched_use_toggle'] = true;
$wgDefaultUserOptions['riched_use_popup'] = false;
$wgDefaultUserOptions['riched_toggle_remember_state'] = true;
$wgDefaultUserOptions['riched_link_paste_text'] = true;
$wgDefaultUserOptions['showtoolbar'] = true;
wfLoadExtension('WYSIWYG');
wfLoadExtension('WikiEditor');

Maybe it helps!

@Guardiandota
Copy link

Hi all.

Delete original WikiEditor extension folder, download latest, copy it to extensions folder.

Download WYSIWIG extension, copy only WYSIWYG folder to extensions folder.

WYSIWYG/extension.json
delete in Hooks section
"LanguageGetMagic" : ["CKeditor_MediaWiki::onLanguageGetMagic"],
"LanguageGetMagic" : ["CKeditor_MediaWiki::onLanguageGetMagic"],

WYSIWYG/CKeditor.body.php
rem strings
near 113
//public static function onLanguageGetMagic( &$magicWords, $langCode ) {
//$magicWords['NORICHEDITOR'] = array( 0, 'NORICHEDITOR' );
//return true;
//}

near 119
//MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );

near 309
//MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );

LocalSettings.php
$wgGroupPermissions['*']['wysiwyg']=true;
$wgGroupPermissions['user']['wysiwyg']=true;
$wgDefaultUserOptions['riched_disable'] = false;
$wgDefaultUserOptions['riched_start_disabled'] = false;
$wgDefaultUserOptions['riched_use_toggle'] = true;
$wgDefaultUserOptions['riched_use_popup'] = false;
$wgDefaultUserOptions['riched_toggle_remember_state'] = true;
$wgDefaultUserOptions['riched_link_paste_text'] = true;
$wgDefaultUserOptions['showtoolbar'] = true;
wfLoadExtension('WYSIWYG');
wfLoadExtension('WikiEditor');

Maybe it helps!

This fixed the problem for me! Thank you!

@usbport11
Copy link

usbport11 commented Jun 1, 2019

Thank you for feedback.
I am not sure that you need to remove everything related to Magic. This requires additional checks.

@usbport11
Copy link

usbport11 commented Jun 3, 2019

Find another problem.
Can not preview page.

Temporary solution (CKeditorEditPage.body.php):
change this

function getPreviewText() {
	if( !$this->isCssJsSubpage ) {
		wfRunHooks( 'EditPageBeforePreviewText', array( &$this, $this->previewOnOpen() ) );
		$result = parent::getPreviewText();
		wfRunHooks( 'EditPagePreviewTextEnd', array( &$this, $this->previewOnOpen() ) );
	} else {
		$result = parent::getPreviewText();
	}
       return $result;
}

to this

function getPreviewText() {
	$result = parent::getPreviewText();
	return $result;
}

@caiofelipedossantos
Copy link

This fixed the problem for me! Thank you!

@jhubbardsf
Copy link

This is still an issue. @usbport11 fixed it with that solution but does obviously it's a bandaid since it's just ripping out magicword uses. Does anyone know where to find documentation on magic word? I feel like this shouldn't be too difficult to get a PR result for if the problem was better understood.

@michaelcheng924
Copy link

Thanks, @usbport11 !

@Dimi-V
Copy link

Dimi-V commented Jan 14, 2020

Hi all.

Delete original WikiEditor extension folder, download latest, copy it to extensions folder.

Download WYSIWIG extension, copy only WYSIWYG folder to extensions folder.

WYSIWYG/extension.json
delete in Hooks section
"LanguageGetMagic" : ["CKeditor_MediaWiki::onLanguageGetMagic"],
"LanguageGetMagic" : ["CKeditor_MediaWiki::onLanguageGetMagic"],

WYSIWYG/CKeditor.body.php
rem strings
near 113
//public static function onLanguageGetMagic( &$magicWords, $langCode ) {
//$magicWords['NORICHEDITOR'] = array( 0, 'NORICHEDITOR' );
//return true;
//}

near 119
//MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );

near 309
//MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );

LocalSettings.php
$wgGroupPermissions['*']['wysiwyg']=true;
$wgGroupPermissions['user']['wysiwyg']=true;
$wgDefaultUserOptions['riched_disable'] = false;
$wgDefaultUserOptions['riched_start_disabled'] = false;
$wgDefaultUserOptions['riched_use_toggle'] = true;
$wgDefaultUserOptions['riched_use_popup'] = false;
$wgDefaultUserOptions['riched_toggle_remember_state'] = true;
$wgDefaultUserOptions['riched_link_paste_text'] = true;
$wgDefaultUserOptions['showtoolbar'] = true;
wfLoadExtension('WYSIWYG');
wfLoadExtension('WikiEditor');

Maybe it helps!

Thank you very much, this helped me out! (v 1.33.0)

@digixc
Copy link

digixc commented May 20, 2020

Thank you! It worked for me! (MW 1.34)

@andquesada
Copy link

Thank you! Worked for me using MW 1.34.2.

Although instead of copying the whole WYSIWYG directory I placed a soft link into the extensions directory.

@robinhair
Copy link

I have this environment:
php: 7.4.9
Mediawiki: 1.34.2
WYSIWIG: 1.5.6_0 [B551+18.09.2018]

I followed the above instruction to amend
WYSIWYG/extension.json
WYSIWYG/CKeditor.body.php
plus added the lines to LocalSettings.php

On loading the Editor I get this error:
Notice: Undefined property: CKeditorParser::$mUniqPrefix in ../httpdocs/mediawiki/extensions/WYSIWYG/CKeditorParser.body.php on line 548

Any thoughts as to what might be causing this error?

Also, the WYSIWIG version was the latest I could find, but 18/09/2018 seems a long time ago! Has it not been updated in 2 years?

@usbport11
Copy link

Strange. I am repeat steps from here and all work.

@robinhair
Copy link

Thanks for responding usbport11 :)

I performed the additional steps (extra to #122) that were listed in #125 and the WikiEditor (0.5.3) worked fine.

But when I enable WYSIWYG and load the editor is still this the same error:
Notice: Undefined property: CKeditorParser::$mUniqPrefix in ../httpdocs/mediawiki/extensions/WYSIWYG/CKeditorParser.body.php on line 548

I upgraded direct from 1.23.5 to 1.34.2 and overwrote the old with the new version. Could it be that some part of 1.23.5 is causing the issue? Also, does PHP 7.4.9 give compatibility problems?

Product Version
MediaWiki 1.34.2
PHP 7.4.9 (fpm-fcgi)
MariaDB 10.1.41-MariaDB
ICU 50.2
Lua 5.1.5

@usbport11
Copy link

usbport11 commented Sep 5, 2020

Thanks for responding usbport11 :)

I performed the additional steps (extra to #122) that were listed in #125 and the WikiEditor (0.5.3) worked fine.

But when I enable WYSIWYG and load the editor is still this the same error:
Notice: Undefined property: CKeditorParser::$mUniqPrefix in ../httpdocs/mediawiki/extensions/WYSIWYG/CKeditorParser.body.php on line 548

I upgraded direct from 1.23.5 to 1.34.2 and overwrote the old with the new version. Could it be that some part of 1.23.5 is causing the issue? Also, does PHP 7.4.9 give compatibility problems?

Product Version
MediaWiki 1.34.2
PHP 7.4.9 (fpm-fcgi)
MariaDB 10.1.41-MariaDB
ICU 50.2
Lua 5.1.5

Made clear install.

[root@localhost ~]# cat /etc/*release
CentOS Linux release 8.2.2004 (Core)

[root@localhost ~]# php -v
PHP 7.4.10 (cli) (built: Sep 1 2020 13:58:08) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.10, Copyright (c), by Zend Technologies

[root@localhost ~]# dnf list installed | grep mariadb
mariadb.x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 @appstream
mariadb-backup.x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 @appstream
mariadb-common.x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 @appstream
mariadb-connector-c.x86_64 3.0.7-1.el8 @appstream
mariadb-connector-c-config.noarch 3.0.7-1.el8 @appstream
mariadb-errmsg.x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 @appstream
mariadb-gssapi-server.x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 @appstream
mariadb-server.x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 @appstream
mariadb-server-utils.x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 @appstream

MediaWiki | 1.34.2
PHP | 7.4.10 (fpm-fcgi)
MariaDB | 10.3.17-MariaDB
WikiEditor | 0.5.2
WYSIWYG editor | Wysiwyg 1.5.6_0 [B551+18.09.2018], CKEditor 4.6.2 (revision 20af917)

All work.

Try install after update.
Delete DB wiki and 1.34.2 version.
Recreate empty DB, download old 1.23.5 wiki, made install, check that wiki work.
Dump DB: mysqldump -u root -p wikidb > /tmp/wikidb.sql.
Rename folder of old wiki.
Download new 1.34.2 wiki and copy to /var/www/html.
Copy LocalSetting.php file from old to new wiki.
Made update DB for wiki: php /var/www/html/wikidb/maitance/update.php.
Fix themes in LocalSetting.php (wfLoadSkin('MonoBook'); wfLoadSkin('Timeless'); wfLoadSkin('Vector'); ).
Test in browser - good.
Then repeat all fix steps - WYSIWYG editor work.

All good. Can not reproduse problem. May be something with updating?

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

10 participants