Page MenuHomePhabricator

StructuredDiscussions is not handling conversion from html to wikitext on MediaWiki 1.39 zero-config setup
Closed, ResolvedPublicBUG REPORT

Description

After updating to MediaWiki version 1.39, the StructuredDiscussions extension stopped working with Visual Editor, a problem definitely related to updates on Parsoid. The error reads:

Exception caught: Conversion from 'html' to 'wikitext' was requested, but core's Parser only supports 'wikitext' to 'html' conversion

Before 1.39, a patch used to be applied and it no longer works as well. Downloading the REL1_39 version of the extension currently breaks MediaWiki and is not stable. Many users were requesting for a ticket to be made on this topic in the talk page for StructuredDiscussions, and so I went ahead and made it already.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Thanks. I've found StructuredDiscussions / Flow much more practical for enterprise MW applications and indeed I'm not the only one. Fixing this issue would be much appreciated until support for Flow can resume from the community (I'm looking into assigning some dev resources to that task).

Tgr moved this task from Inbox to Triaged on the Growth-Team board.
Tgr subscribed.

I'm afraid we don't offer much in the way of StructuredDiscussions maintenance/support (see T325222), other than fixing issues that are highly disruptive on Wikimedia wikis. Also, StructuredDiscussions issues do not block MediaWiki releases as it is not one of the bundled extensions.

Also, given that StructuredDiscussions does work on Wikimedia wikis, this seems an issue with the configuration, not the extension; the linked patch is about supporting a zero-config setup, but you probably wouldn't need a patch if it is correctly confiugred.

Tgr renamed this task from StructuredDiscussions is not handling conversion from html to wikitext [1.39] to StructuredDiscussions is not handling conversion from html to wikitext on MediaWiki 1.39 zero-config setup.Feb 21 2023, 5:59 AM

For me, doing the steps as described in https://www.mediawiki.org/wiki/Parsoid#Installation worked.

That is, I just added wfLoadExtension( 'Parsoid', "$IP/vendor/wikimedia/parsoid/extension.json" ); to LocalSettings.php and everything worked just fine again.

As described there, "This is expected to change for the release of 1.36." but we are on 1.39 already. EDIT: I removed it from there

@Tgr do you know if loading parsoid in this way is still the preferred way? (Or do you know someone who does know this)

@Tgr do you know if loading parsoid in this way is still the preferred way?

Wikimedia does it too so presumably yes.

Unfortunately, it still continues to occur in my environment even after adding the code to load that parsoid.

Did you apply the patch?

You should at least do the changes that are listed here:
https://phabricator.wikimedia.org/T260648#6645078

That is, these changes:

diff --git a/includes/Conversion/Utils.php b/includes/Conversion/Utils.php
index 711b25587..3b7981c38 100644
--- a/includes/Conversion/Utils.php
+++ b/includes/Conversion/Utils.php
@@ -295,7 +295,7 @@ abstract class Utils {
        private static function makeVRSObject() {
                global $wgVirtualRestConfig, $wgFlowParsoidURL, $wgFlowParsoidPrefix,
                        $wgFlowParsoidTimeout, $wgFlowParsoidForwardCookies,
-                       $wgFlowParsoidHTTPProxy;
+                       $wgFlowParsoidHTTPProxy, $wgVisualEditorParsoidAutoConfig;
 
                // the params array to create the service object with
                $params = [];
@@ -315,6 +315,12 @@ abstract class Utils {
                        // there's a global parsoid config, use it next
                        $params = $vrs['modules']['parsoid'];
                        $params['restbaseCompat'] = true;
+               } elseif ( $wgVisualEditorParsoidAutoConfig ) {
+                       $params = $vrs['modules']['parsoid'] ?? [];
+                       $params['restbaseCompat'] = true;
+                       // forward cookies on private wikis
+                       $params['forwardCookies'] = !MediaWikiServices::getInstance()
+                               ->getPermissionManager()->isEveryoneAllowed( 'read' );
                } else {
                        // no global modules defined, fall back to old defaults
                        if ( !$wgFlowParsoidURL ) {
matmarex added a project: MW-1.41-notes.
matmarex subscribed.

This problem should no longer occur on MediaWiki 1.41 and later. In T337223 the Parsoid integration has been redone, and it should be much more reliable now.