Topic on Talk:Structured Discussions

Using VisualEditor in Flow

18
81.22.162.228 (talkcontribs)

I get this error when I'm trying to use VisualEditor in Flow conversations:

[9149bd06] Exception Caught: Conversion from 'html' to 'wikitext' was requested, but core's Parser only supports 'wikitext' to 'html' conversion.

VisualEditor is working on other sites normally.

I have these lines in my LocalSettings.php:

$wgVisualEditorParsoidURL = 'http://localhost:8000';

$wgVisualEditorParsoidForwardCookies = true;

$wgSessionsInObjectCache = true;

$wgFlowContentFormat = 'html';

$wgFlowEditorList = array( 'visualeditor', 'none' );

Parsoid seems to depub html > wikitext without problems.

Can you tell how to fix this?

Mattflaschen-WMF (talkcontribs)

What version/git commit of Flow and core do you have?

In recent versions of Flow, you need to use $wgVirtualRestConfig (recommended, if it's mentioned in your Flow.php) or $wgFlowParsoid* variables (either the only way, or a deprecated but still-working way).

Mattflaschen-WMF (talkcontribs)
81.22.162.228 (talkcontribs)

I'm using the latest version. I haven't defined $wgVirtualRestConfig in my LocalSettings.php and I cant find this from Flow.php. Flow parsoid configuration looks like this:

$wgFlowParsoidURL = null; // also see $wgVisualEditorParsoidURL

$wgFlowParsoidPrefix = null; // also see $wgVisualEditorParsoidPrefix

$wgFlowParsoidTimeout = null; // also see $wgVisualEditorParsoidTimeout

If i set $wgFlowParsoidURL = http://localhost:8000 i get an error: [c949daba] Exception Caught: Failed contacting Parsoid and neither editor is working in Flow conversations.

81.22.162.228 (talkcontribs)

This is what logfile says:

FlowHooks::initFlowExtension: Warning: $wgFlowContentFormat was set to 'html', but you do not have Parsoid enabled.  Changing $wgFlowContentFormat to 'wikitext'


81.22.162.228 (talkcontribs)

...and i've checked: Parsoid service is up and running. I even tested it on http://localhost:8000 and its working normally.

Mattflaschen-WMF (talkcontribs)

What do you have for all the $wgFlowParsoid... variables in your LocalSettings.php? You only mentioned one. They should all (well, one or two are optional) be set to the same as their equivalent VE one is/would be.

If you use IRC, joining us in #wikimedia-collaboration on Freenode may be faster.

81.22.162.228 (talkcontribs)

require_once "$IP/extensions/VisualEditor/VisualEditor.php";

$wgVisualEditorParsoidURL = 'http://localhost:8000';

$wgVisualEditorParsoidForwardCookies = true;

$wgSessionsInObjectCache = true;

require_once "$IP/extensions/Flow/Flow.php";

$wgFlowContentFormat = 'html';

$wgFlowEditorList = array( 'visualeditor', 'none' );

#$wgFlowParsoidURL = 'http://localhost:8000';

$wgVirtualRestConfig['modules']['parsoid'] = array(

  'url' => 'http://localhost:8000',

  'domain' => 'localhost',

  'prefix' => 'localhost',

);

I also have defined namespaces but I didn't write those here. I haven't made changes to Flow.php or VisualEditor.php.

Mattflaschen-WMF (talkcontribs)

If $wgVirtualRestConfig is not mentioned in a comment in Flow.php, there is no need to set it for Flow's purposes, and it won't have any effect on Flow (other than maybe confusing people).

You should uncomment $wgFlowParsoidURL and also set $wgFlowParsoidPrefix, $wgFlowParsoidTimeout, and $wgFlowParsoidForwardCookies.

I think:

$wgFlowParsoidURL = 'http://localhost:8000';
$wgFlowParsoidPrefix = $wgDBname;
$wgFlowParsoidTimeout = 100;
$wgFlowParsoidForwardCookies = true;

should work.

You can raise the timeout if wanted/needed.

81.22.162.228 (talkcontribs)

Hi

$wgVirtualRestConfig is not mentioned in Flow.php. Should I use these in LocalSettings.php or Flow.php?

$wgFlowParsoidURL = 'http://localhost:8000'; // also see $wgVisualEditorParsoidURL

$wgFlowParsoidPrefix = $wgDBname; // also see $wgVisualEditorParsoidPrefix

$wgFlowParsoidTimeout = 100; // also see $wgVisualEditorParsoidTimeout

$wgFlowParsoidForwardCookies = true;

If set these settings to LocalSettings.php and comment in Flow.php I get: "Due to a technical error, this post could not be retrieved." Failed connecting parsoid. Neither editor is working (WysiWYG, VE). If I do vice versa I get the same error. If I set these above setting to both files I get the same error.

Why does it fail if i use VisualEditor for e.g. new pages and can save those successfully. Ii can still access and see parsoid running at the server. I've restarted the service.

If i comment these setting in both of the files, WysiWYG wikitext editor is working but VE gives: Exception Caught: Conversion from 'html' to 'wikitext' was requested, but core's Parser only supports 'wikitext' to 'html' conversion.

My LocalSettings.php:

require_once "$IP/extensions/VisualEditor/VisualEditor.php";

$wgDefaultUserOptions['visualeditor-enable'] = 1;

$wgHiddenPrefs[] = 'visualeditor-enable';

$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;

$wgVisualEditorParsoidURL = 'http://localhost:8000';

$wgVisualEditorParsoidForwardCookies = true;

$wgSessionsInObjectCache = true;

require_once "$IP/extensions/Flow/Flow.php";

$wgNamespaceContentModels[NS_PROJECT_TALK] = CONTENT_MODEL_FLOW_BOARD;

$wgNamespaceContentModels[NS_USER_TALK] = CONTENT_MODEL_FLOW_BOARD;

$wgNamespaceContentModels[NS_CATEGORY_TALK] = CONTENT_MODEL_FLOW_BOARD;

$wgNamespaceContentModels[NS_USER] = CONTENT_MODEL_FLOW_BOARD;

$wgNamespaceContentModels[NS_TALK] = CONTENT_MODEL_FLOW_BOARD;

$wgFlowContentFormat = 'html';

$wgFlowEditorList = array( 'visualeditor', 'none' );

require_once "$IP/extensions/Echo/Echo.php";

If I add this to LocalSettings.php:

$wgVirtualRestConfig['modules']['parsoid'] = array(

 

'url' => 'http://localhost:8000',

 

'domain' => $wdDBname,

 

'prefix' => '100'

);

I get: [98970307] Exception Caught: Conversion from 'html' to 'wikitext' was requested, but core's Parser only supports 'wikitext' to 'html' conversion


81.22.162.228 (talkcontribs)

I corrected this one in LocalSettings.php:

$wgVirtualRestConfig['modules']['parsoid'] = array(

 

'url' => 'http://localhost:8000',

 

'domain' => 'localhost',

 

'prefix' => 'localhost'

);

I also tested echo 'Foo' | node parse and it is working.

81.22.162.228 (talkcontribs)

Log file still says: Warning: $wgFlowContentFormat was set to 'html', but you do not have Parsoid enabled.

Mattflaschen-WMF (talkcontribs)

$wgVirtualRestConfig is not going to work with your version of Flow. Please do not change or post that setting.

Never change settings in Flow.php (unless you're a developer working on Flow, but that's a different matter). Please change Flow.php back to the version you downloaded.

Add the lines I mentioned to LocalSettings.php ($wgFlowParsoidURL, $wgFlowParsoidPrefix, $wgFlowParsoidTimeout, $wgFlowParsoidForwardCookies).

After changing LocalSettings.php, retest. If it doesn't work, post your full LocalSettings.php.

> Why does it fail if i use VisualEditor for e.g. new pages and can save those successfully. Ii can still access and see parsoid running at the server. I've restarted the service.

Flow uses a different set of settings.

81.22.162.228 (talkcontribs)

Hi, Flow.php restored from the original file. Changed settings as you described - not working: Failed to contact Parsoid. Here is the LocalSettings.php:

#This file was automatically generated by the MediaWiki 1.25.1

# installer. If you make manual changes, please keep track in case you

# need to recreate them later.

#

# See includes/DefaultSettings.php for all configurable settings

# and their default values, but don't forget to make changes in _this_

# file, not there.

#

# Further documentation for configuration settings may be found at:

# https://www.mediawiki.org/wiki/Manual:Configuration_settings


# Protect against web entry

if ( !defined( 'MEDIAWIKI' ) ) {

exit;

}


# Uncomment this to disable output compression

# $wgDisableOutputCompression = true;

$wgSitename = "Raksu";


####### UPLOAD FILE TYPES #######

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc',

    'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx',

    'pptx', 'ps', 'odt', 'ods', 'odp', 'odg', 'pdf');


# Custom Mediawiki settings

// Search settings

$wgAdvancedSearchHighlighting = true;

$wgEnableMWSuggest = true;

$wgUseTwoButtonsSearchForm = true;

#Set default searching

$wgNamespacesToBeSearchedDefault = array(

NS_MAIN =>           true,

NS_TALK =>           false,

NS_USER =>           false,

NS_USER_TALK =>      false,

NS_PROJECT =>        false,

NS_PROJECT_TALK =>   false,

NS_FILE =>           false,

NS_FILE_TALK =>      false,

NS_MEDIAWIKI =>      false,

NS_MEDIAWIKI_TALK => false,

NS_TEMPLATE =>       false,

NS_TEMPLATE_TALK =>  false,

NS_HELP =>           false,

NS_HELP_TALK =>      false,

NS_CATEGORY =>       true,

NS_CATEGORY_TALK =>  false,

);

## The URL base path to the directory containing the wiki;

## defaults for all runtime URL paths are based off of this.

## For more information on customizing the URLs

## (like /w/index.php/Page_title to /wiki/Page_title) please see:

## https://www.mediawiki.org/wiki/Manual:Short_URL

$wgScriptPath = "";

$wgScriptExtension = ".php";


## The protocol and server name to use in fully-qualified URLs

$wgServer = "";


## The relative URL path to the skins directory

$wgStylePath = "$wgScriptPath/skins";

$wgResourceBasePath = $wgScriptPath;

## The relative URL path to the logo.  Make sure you change this from the default,

## or else you'll overwrite your logo when you upgrade!

$wgLogo = "$wgResourceBasePath/resources/assets/raksu_uusilogo.png";


## UPO means: this is also a user preference option

$wgEnableEmail = true;

$wgEnableUserEmail = true; # UPO


$wgEmergencyContact = "";

$wgPasswordSender = "";


$wgEnotifUserTalk = false; # UPO

$wgEnotifWatchlist = false; # UPO

$wgEmailAuthentication = false;


## Database settings

$wgDBtype = "mysql";

$wgDBserver = "localhost";

$wgDBname = "wikidb";

$wgDBuser = "";

$wgDBpassword = "";


# MySQL specific settings

$wgDBprefix = "";


# MySQL table options to use during installation or update

$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";


# Experimental charset support for MySQL 5.0.

$wgDBmysql5 = false;


## Shared memory settings

$wgMainCacheType = CACHE_NONE;

$wgMemCachedServers = array();


## To enable image uploads, make sure the 'images' directory

## is writable, then set this to true:

$wgEnableUploads = true;

$wgUseImageMagick = true;

$wgImageMagickConvertCommand = "/usr/bin/convert";


# InstantCommons allows wiki to use images from http://commons.wikimedia.org

$wgUseInstantCommons = false;

## If you use ImageMagick (or any other shell command) on a

## Linux server, this will need to be set to the name of an

## available UTF-8 locale

$wgShellLocale = "en_US.utf8";


## If you want to use image uploads under safe mode,

## create the directories images/archive, images/thumb and

## images/temp, and make them all writable. Then uncomment

## this, if it's not already uncommented:

#$wgHashedUploadDirectory = false;


## Set $wgCacheDirectory to a writable directory on the web server

## to make your wiki go slightly faster. The directory should not

## be publically accessible from the web.

#$wgCacheDirectory = "$IP/cache";

# Site language code, should be one of the list in ./languages/Names.php

$wgLanguageCode = "fi";


$wgSecretKey = "secret_key_hided";

# Site upgrade key. Must be set to a string (default provided) to turn on the

# web installer while LocalSettings.php is in place

$wgUpgradeKey = "";

## For attaching licensing metadata to pages, and displaying an

## appropriate copyright notice / icon. GNU Free Documentation

## License and Creative Commons licenses are supported so far.

$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright

$wgRightsUrl = "";

$wgRightsText = "";

$wgRightsIcon = "";

# Path to the GNU diff3 utility. Used for conflict resolution.

$wgDiff3 = "/usr/bin/diff3";

# The following permissions were set based on your choice in the installer

$wgGroupPermissions['*']['edit'] = false;

## Default skin: you can change the default skin. Use the internal symbolic

## names, ie 'vector', 'monobook':

$wgDefaultSkin = "vector";

# Enabled skins.

# The following skins were automatically enabled:

wfLoadSkin( 'CologneBlue' );

wfLoadSkin( 'Modern' );

wfLoadSkin( 'MonoBook' );

wfLoadSkin( 'Vector' );


# Enabled Extensions. Most extensions are enabled by including the base extension file here

# but check specific extension documentation for more details

# The following extensions were automatically enabled:

wfLoadExtension( 'Cite' );

wfLoadExtension( 'CiteThisPage' );

wfLoadExtension( 'Gadgets' );

wfLoadExtension( 'ImageMap' );

wfLoadExtension( 'InputBox' );

wfLoadExtension( 'Nuke' );

wfLoadExtension( 'PdfHandler' );

wfLoadExtension( 'Renameuser' );

wfLoadExtension( 'SyntaxHighlight_GeSHi' );

wfLoadExtension( 'TitleBlacklist' );

wfLoadExtension( 'WikiEditor' );


# End of automatically generated settings.

# Add more configuration options below.

# WikiEditor settings

# Enables use of WikiEditor by default but still allow users to disable it in preferences

$wgDefaultUserOptions['usebetatoolbar'] = 1;

$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;


# Displays the Preview and Changes tabs

$wgDefaultUserOptions['wikieditor-preview'] = 1;


# Displays the Publish and Cancel buttons on the top right side

$wgDefaultUserOptions['wikieditor-publish'] = 1;

#Set Default Timezone

$wgLocaltimezone = "Europe/Helsinki";

$wgLocalTZoffset = date("Z") / 60;


# EXTENSION: UNIVERSAL LANGUAGE SELECTOR

require_once "$IP/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php";

# EXTENSION: Visual Editor

require_once "$IP/extensions/VisualEditor/VisualEditor.php";


// Enable by default for everybody

$wgDefaultUserOptions['visualeditor-enable'] = 1;

// Don't allow users to disable it

$wgHiddenPrefs[] = 'visualeditor-enable';

// OPTIONAL: Enable VisualEditor's experimental code features

$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;

// URL to the Parsoid instance

// MUST NOT end in a slash due to Parsoid bug

// Use port 8142 if you use the Debian package

$wgVisualEditorParsoidURL = 'http://localhost:8000';

$wgVisualEditorParsoidForwardCookies = true;

$wgSessionsInObjectCache = true;

$wgVisualEditorNamespaces ['*'];

#$wgVisualEditorNamespaces = array( NS_MAIN, NS_TALK, NS_USER, NS_USER_TALK, NS_CATEGORY);

# EXTENSION: Confirm Account

require_once "$IP/extensions/ConfirmAccount/ConfirmAccount.php";

#$wgConfirmAccountRequestFormItems['Biography']['minWords'] = 0;

$wgConfirmAccountRequestFormItems['Biography']['enabled'] = false;

#$wgConfirmAccountRequestFormItems['Areasofinterest']['enabled'] = false;

 $wgMakeUserPageFromBio = false;

 $wgAutoWelcomeNewUsers = false;

 $wgConfirmAccountRequestFormItems = array(

 'UserName'        => array( 'enabled' => true ),

 'RealName'        => array( 'enabled' => true ),

 'Biography'       => array( 'enabled' => false, 'minWords' => 50 ),

 'AreasOfInterest' => array( 'enabled' => false ),

 'CV'              => array( 'enabled' => false ),

 'Notes'           => array( 'enabled' => false ),

 'Links'           => array( 'enabled' => false ),

 'TermsOfService'  => array( 'enabled' => false ),

 );

# USER RIGHTS

# Disable reading by anonymous users

$wgGroupPermissions['*']['read'] = false;

# But allow them to access the login page or else there will be no way to log in!

# [You also might want to add access to "Main Page", "Wikipedia:Help", etc.)

# But allow them to read e.g., these pages:

$wgWhitelistRead = array ("Main Page", "Special:Userlogin", "Help:Contents", "-", "Special:Requestaccount", "Toiminnot:Pyydä_käyttäjätunnusta");

#$wgGroupPermissions['*']['createaccount'] = false;

# EXTENSION: Input box

wfLoadExtension( 'InputBox' );

# EXTENSION: Fancy Box Thumbs

require_once("$IP/extensions/FancyBoxThumbs/FancyBoxThumbs.php");

# EXTENSION: MediaWiki Chat

require_once "$IP/extensions/MediaWikiChat/MediaWikiChat.php";

# EXTENSION: Access Control

require_once("extensions/AccessControl/AccessControl.php");

# EXTENSION: User merge and delete

require_once "$IP/extensions/UserMerge/UserMerge/UserMerge.php";

// By default nobody can use this function, enable for bureaucrat?

$wgGroupPermissions['bureaucrat']['usermerge'] = true;

// optional: default is array( 'sysop' )

$wgUserMergeProtectedGroups = array( 'groupname' );

# EXTENSION: Enable Subpages

# Enable subpages in the main namespace

$wgNamespacesWithSubpages[NS_MAIN] = true;

# Enable subpages in the template namespace

$wgNamespacesWithSubpages[NS_TEMPLATE] = true;

# EXTENSION: Hide Prefix 

require_once "$IP/extensions/HidePrefix/HidePrefix/HidePrefix.php";

# EXTENSION: Flow

#The Flow extension provides a new discussion and collaboration system for talk pages

require_once "$IP/extensions/Flow/Flow.php";

#To enable Flow for a namespace, use $wgNamespaceContentModels. For example:

#$wgNamespaceContentModels[NS_PROJECT_TALK] = CONTENT_MODEL_FLOW_BOARD;

$wgNamespaceContentModels[NS_USER_TALK] = CONTENT_MODEL_FLOW_BOARD;

$wgNamespaceContentModels[NS_CATEGORY_TALK] = CONTENT_MODEL_FLOW_BOARD;

#$wgNamespaceContentModels[NS_USER] = CONTENT_MODEL_FLOW_BOARD;

$wgNamespaceContentModels[NS_TALK] = CONTENT_MODEL_FLOW_BOARD;

#$wgNamespaceContentModels[NS_TIEDOTTEET_TALK] = CONTENT_MODEL_FLOW_BOARD;

$wgFlowContentFormat = 'html';

$wgFlowEditorList = array( 'visualeditor', 'none' );

// Parsoid configuration

#Flow uses the Virtual REST Service to contact a Parsoid or RESTBase service. 

#If your wiki loads the VisualEditor extension, then you've probably already set this up.

$wgFlowParsoidURL = 'http://localhost:8000'; // also see $wgVisualEditorParsoidURL

$wgFlowParsoidPrefix = $wgDBname; // also see $wgVisualEditorParsoidPrefix

$wgFlowParsoidTimeout = 100; // also see $wgVisualEditorParsoidTimeout

$wgFlowParsoidForwardCookies = true;

//Flow talk notifications

require_once "$IP/extensions/Echo/Echo.php";

81.22.162.228 (talkcontribs)

Im still fighting with this issue. Please Help.

Wess (talkcontribs)

Have you found a solution for this?

Knomanii (talkcontribs)

Was this issue with Flow not working with VisualEditor ever resolved?

When this issue is brought up again (see phab:T267407) folks seem to reference this thread.

But this thread only shows that the issue was never resolved, no?

OP's last message states that the recommended settings didn't fix the issue.

I'm also facing this issue and the recommend settings for $wgFlowParsoidURL, $wgFlowParsoidPrefix, $wgFlowParsoidTimeout, $wgFlowParsoidForwardCookies didn't resolve it.

I also created a new thread about this issue here:

Topic:Vw6bf78zvy5fvlsi

Reply to "Using VisualEditor in Flow"