EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/145748
Change subject: Repair bad data send to IRC feed
......................................................................
Repair bad data send to IRC feed
To have access to the properties needed to generate an
IRC line we need to call RevisionFormatter::setIncludeHistoryProperties.
Additionally, we dont want the irc formatters need of history properties
to cause everything else to also render history properties, so
remove the Pimple::share() wrapping formatter.revision in the container.
This problem is currently outputing logs like the following to logs on betalabs:
2014-07-11 03:31:40 deployment-apache01 enwiki:
Flow\Formatter\IRCLineUrlFormatter::formatDescription: Missing expected
parameter
user-text for change type reply
Change-Id: Ib4547dbc69f0fa12efba6511f10c541da78179aa
---
M container.php
M includes/Formatter/IRCLineUrlFormatter.php
2 files changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/48/145748/1
diff --git a/container.php b/container.php
index 11f3cdc..776571c 100644
--- a/container.php
+++ b/container.php
@@ -766,7 +766,12 @@
$c['repository.tree']
);
} );
-$c['formatter.revision'] = $c->share( function( $c ) {
+// The RevisionFormatter holds internal state like
+// contentType of output and if it should include history
+// properties. To prevent different code using the formatter
+// from causing problems return a new RevisionFormatter every
+// time it is requested.
+$c['formatter.revision'] = function( $c ) {
global $wgFlowMaxThreadingDepth;
return new Flow\Formatter\RevisionFormatter(
@@ -775,7 +780,7 @@
$c['repository.username'],
$wgFlowMaxThreadingDepth
);
-} );
+};
$c['formatter.topiclist'] = $c->share( function( $c ) {
return new Flow\Formatter\TopicListFormatter(
$c['url_generator'],
diff --git a/includes/Formatter/IRCLineUrlFormatter.php
b/includes/Formatter/IRCLineUrlFormatter.php
index b19b0af..6c4cbb5 100644
--- a/includes/Formatter/IRCLineUrlFormatter.php
+++ b/includes/Formatter/IRCLineUrlFormatter.php
@@ -25,6 +25,7 @@
$rcRow = $query->getResult( null, $rc );
$ctx = \RequestContext::getMain();
$data = $this->serializer->formatApi( $rcRow, $ctx );
+ $this->serializer->setIncludeHistoryProperties( true );
$rc->mAttribs['rc_comment'] = $this->formatDescription( $data,
$ctx );
/** @var RCFeedFormatter $formatter */
$formatter = new $feed['original_formatter']();
--
To view, visit https://gerrit.wikimedia.org/r/145748
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4547dbc69f0fa12efba6511f10c541da78179aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits