Topic on Extension talk:VisualEditor

Got VE working with workaround '$wgUser' - unclear why

5
MW Kappa (talkcontribs)

We got the following configuration to work

ComponentVersion
MediaWiki1.32.2
Parsoid0.10.0
VisualEditor0.1.0 (e82e120) 23:48, 18. Mär. 2019
PHP 7.3.6

This is the activation of VE in LocalSettings.php

# ----------------------------------------------------------------------
# VisualEditor                              
# ----------------------------------------------------------------------
wfLoadExtension( 'VisualEditor' );
$wgDefaultUserOptions['visualeditor-enable']	= 1;
$wgDefaultUserOptions['visualeditor-editor']	= 'visualeditor';
$wgHiddenPrefs[]				= 'visualeditor-enable';
$wgVirtualRestConfig['modules']['parsoid']	= array(
							'url' => 'http://localhost:8142',
							'domain' => 'mediawikitest');

// this workaround is needed for the functioning of VE - unclear why

function workaround_for_ve() {
	global $wgUser;
	$wgUser->getID();
	return true;
}

$wgHooks['SpecialPage_initList'][]='workaround_for_ve';

The corresponding entry in /etc/mediawiki/parsoid/config.yaml is

services:
  - module: ../src/lib/index.js
    entrypoint: apiServiceWorker
    conf:
        # Configure Parsoid to point to your MediaWiki instances.
        mwApis:
        - # Editorsettings for mediawikitest
          uri: 'http://localhost/mediawikitest/api.php'
          domain: 'mediawikitest'

Before adding this workaround our wiki had the following behaviour: Upon clicking the 'edit' tab the loading bar of VE shortly flashed up, disappeared and left the browser address '..mediawikitest/index.php/mainpage?veaction=edit'

The strange thing is the workaround we needed, and we would like to know if someone has an explanation, why this workaround works, and whether there is a direct solution for achieving the same result. MW Kappa (talk) 16:32, 22 July 2019 (UTC)

Spas.Z.Spasov (talkcontribs)

Hello. As I know MediaWiki doesnt't support PHP 7.3 yet, but I can't say whether this is the reason of your issue. I'm using the same MW, Parsoid and VE versions, but PHP on my server is 7.2 - and there is no such issue. Probably it will be usefull here to post also the Rewrite rules of your MediaWiki virtual host (or .htaccess) configuration.

MW Kappa (talkcontribs)

Thank you very much for your quick reply. I have not tested going back to PHP 7.2. MW 1.32.2 and lots of extensions are running well with PHP 7.3. But my question is: are there special requirements for rewrite rules for Parsoid? MW Kappa (talk) 15:46, 24 July 2019 (UTC)

Spas.Z.Spasov (talkcontribs)

Yes, most of the extensions and MW itself behave well with PHP 7.3, but I found that, some of the CLI scripts doesn't work with PHP 7.3, so probably and the web interface could experience some issues. Also recently, on the support desk, I found a discussion, where was described that MW 1.32 doesn't support officially PHP 7.3.

Actually I've used PHP 7.3 with my wiki for few weeks, before switch back to 7.2, and can't remember such issue as yours, so probably the cause of the issue is elsewhere, but who knows :)

I think there are not special requirements for rewrite rules for Parsoid. I meant that, if you already have some (incomplete) rules they could cause some problems.

This is not related to the issue, but I would like to edit the server's hosts file in order to access the wiki via FDQN instead of localhost or IP address, an example configuration is shown in the bottom of this post of mine.

84.254.96.125 (talkcontribs)

Hello

I have also a MediaWiki (Bluespice) and running it with PHP 7.3. Im also having this issue that a blank site opens if i want to edit. Im running my MediaWiki with XAMPP on a Shared Host. Thats why i have to run Parsoid with Heroku. Unfortunately your workaround dont work with Heroku :/


Any help please

Reply to "Got VE working with workaround '$wgUser' - unclear why"