jenkins-bot has submitted this change and it was merged.

Change subject: Don't use getContent in optIn
......................................................................


Don't use getContent in optIn

It may need to resolve the title (to convert) and we've
had funny dealings with that before.
Also, we shouldn't assume the default format for
getContent will always be 'html'.

Change-Id: I4ff29536260214333dd5e7b5834102a7376be89a
---
M includes/Import/OptInController.php
1 file changed, 11 insertions(+), 5 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Import/OptInController.php 
b/includes/Import/OptInController.php
index c4d4a18..d979c70 100644
--- a/includes/Import/OptInController.php
+++ b/includes/Import/OptInController.php
@@ -408,11 +408,17 @@
 
                $collection = HeaderCollection::newFromId( $workflowId );
                $revision = $collection->getLastRevision();
-               $content = $revision->getContent();
 
-               if ( $format === 'wikitext' ) {
-                       $content = Utils::convert( 'html', 'wikitext', 
$content, $title );
-               }
+               /*
+                * We could just do $revision->getContent( $format ), but that
+                * may need to find $title in order to convert.
+                * We already know $title (and don't want to risk it being used
+                * in a way it stores lagging slave data), so let's just
+                * manually convert the content.
+                */
+               $content = $revision->getContentRaw();
+               $content = Utils::convert( $revision->getContentFormat(), 
$format, $content, $title );
+
                $newDescription = call_user_func( $newDescriptionCallback, 
$content );
 
                $action = 'edit-header';
@@ -424,7 +430,7 @@
                        ),
                );
 
-               /** @var WorkflowLoaderFactory $loader */
+               /** @var WorkflowLoaderFactory $factory */
                $factory = Container::get( 'factory.loader.workflow' );
 
                /** @var WorkflowLoader $loader */

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

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

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

Reply via email to