Legoktm has submitted this change and it was merged.

Change subject: Override $wgFlowContentFormat to wikitext if there is no 
Parsoid URL
......................................................................


Override $wgFlowContentFormat to wikitext if there is no Parsoid URL

Bug: T93956
Change-Id: I014436f680f174452233d5c66e77e60091e9b7e6
---
M Flow.php
M Hooks.php
2 files changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Legoktm: Verified; Looks good to me, approved



diff --git a/Flow.php b/Flow.php
index e57f586..e8538e5 100644
--- a/Flow.php
+++ b/Flow.php
@@ -175,6 +175,8 @@
 // running, as it'll be necessary to convert HTML to wikitext for the basic 
editor.
 // (n.b. to use VisualEditor, you'll definitely need Parsoid, so if you do 
support VE,
 // might as well set this to HTML right away)
+// If $wgFlowParsoidURL is null, $wgFlowContentFormat will be forced to 
wikitext.
+//
 $wgFlowContentFormat = 'html'; // possible values: html|wikitext XXX bug 70148 
with wikitext
 
 // Flow Parsoid config
diff --git a/Hooks.php b/Hooks.php
index de4af73..75fd6e1 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -74,6 +74,8 @@
         * from $wgExtensionFunctions
         */
        public static function initFlowExtension() {
+               global $wgFlowContentFormat, $wgFlowParsoidURL;
+
                // needed to determine if a page is occupied by flow
                self::getOccupationController();
 
@@ -88,6 +90,11 @@
                        self::getAbuseFilter();
                }
 
+               if ( $wgFlowContentFormat === 'html' && $wgFlowParsoidURL === 
null ) {
+                       wfDebugLog( 'Flow', __METHOD__ . ': Warning: 
$wgFlowContentFormat was set to \'html\', but you do not have Parsoid enabled.  
Changing $wgFlowContentFormat to \'wikitext\'' );
+                       $wgFlowContentFormat = 'wikitext';
+               }
+
                // development dependencies to simplify testing
                if ( defined( 'MW_PHPUNIT_TEST' ) && file_exists( __DIR__ . 
'/vendor/autoload.php' ) ) {
                        require_once __DIR__ . '/vendor/autoload.php';

-- 
To view, visit https://gerrit.wikimedia.org/r/199976
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I014436f680f174452233d5c66e77e60091e9b7e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to