Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/240084
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/84/240084/1
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: newchange
Gerrit-Change-Id: I4ff29536260214333dd5e7b5834102a7376be89a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits