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

Change subject: No longer load blocks to format
......................................................................


No longer load blocks to format

The blocks were being loaded and passed through the formatting
code for 2 values in the messages, the workflow id and the
type to use in query strings.  Both of those values were already
available, so skip creating the blocks.

There was one other use of the block, to get access to storage and
through it the previous revisions content.  This was already a bit
of a hack so just switched it to Container::get( 'storage' ).

Change-Id: Ie7c95ab5a0dbbc6c92822a59b0b480d2ddafabbe
---
M FlowActions.php
M includes/Contributions/Formatter.php
M includes/Formatter.php
M includes/RecentChanges/Formatter.php
M includes/View/History/HistoryRenderer.php
5 files changed, 81 insertions(+), 108 deletions(-)

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



diff --git a/FlowActions.php b/FlowActions.php
index b8d5501..000d19a 100644
--- a/FlowActions.php
+++ b/FlowActions.php
@@ -2,6 +2,7 @@
 
 use Flow\Model\PostRevision;
 use Flow\Model\Header;
+use Flow\Model\UUID;
 use Flow\RevisionActionPermissions;
 use Flow\Log\Logger;
 use Flow\Block\Block;
@@ -38,10 +39,10 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-create-header',
                        'i18n-params' => array(
-                               function ( Header $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( Header $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( Header $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( Header $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
                        ),
@@ -59,10 +60,10 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-edit-header',
                        'i18n-params' => array(
-                               function ( Header $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( Header $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( Header $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( Header $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
                        ),
@@ -80,24 +81,24 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-edit-title',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return 
$templating->getUrlGenerator()->generateUrl( $revision->getPostId() );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        // make sure topic title isn't parsed
                                        $content = $templating->getContent( 
$revision, 'wikitext', $user );
                                        return array( 'raw' => 
htmlspecialchars( $content ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        $previousId = 
$revision->getPrevRevisionId();
                                        if ( $previousId ) {
-                                               $previousRevision = 
$block->getStorage()->get( get_class( $revision ), $previousId );
+                                               $previousRevision = 
Container::get( 'storage' )->get( get_class( $revision ), $previousId );
                                                // make sure topic title isn't 
parsed
                                                $content = 
$templating->getContent( $previousRevision, 'wikitext', $user );
                                                return array( 'raw' => 
htmlspecialchars( $content ) );
@@ -120,16 +121,16 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-new-post',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return 
$templating->getUrlGenerator()->generateUrl( $revision->getPostId() );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        // make sure topic title isn't parsed
                                        $content = $templating->getContent( 
$revision, 'wikitext', $user );
                                        return array( 'raw' => 
htmlspecialchars( $content ) );
@@ -152,14 +153,14 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-edit-post',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array(), 'flow-post-' . $revision->getPostId()->getHex() );
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array(), 
'flow-post-' . $revision->getPostId()->getHex() );
                                },
                        ),
                        'class' => 'flow-history-edit-post',
@@ -179,24 +180,24 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-hid-post',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        $fragment = '';
                                        $permissions = 
$templating->getActionPermissions( $user );
                                        if ( $permissions->isAllowed( 
$revision, 'view' ) ) {
                                                $fragment = 'flow-post-' . 
$revision->getPostId()->getHex();
                                        }
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array(), $fragment );
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array(), 
$fragment );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -214,19 +215,19 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-hid-topic',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array() );
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array() );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -245,24 +246,24 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-deleted-post',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        $fragment = '';
                                        $permissions = 
$templating->getActionPermissions( $user );
                                        if ( $permissions->isAllowed( 
$revision, 'view' ) ) {
                                                $fragment = 'flow-post-' . 
$revision->getPostId()->getHex();
                                        }
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array(), $fragment );
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array(), 
$fragment );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -281,19 +282,19 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-deleted-topic',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array() );
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array() );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -313,24 +314,24 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-suppressed-post',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        $fragment = '';
                                        $permissions = 
$templating->getActionPermissions( $user );
                                        if ( $permissions->isAllowed( 
$revision, 'view' ) ) {
                                                $fragment = 'flow-post-' . 
$revision->getPostId()->getHex();
                                        }
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array(), $fragment );
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array(), 
$fragment );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -350,19 +351,19 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-suppressed-topic',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array() );
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array() );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -388,19 +389,19 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-restored-post',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array(), 'flow-post-' . $revision->getPostId()->getHex() );
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array(), 
'flow-post-' . $revision->getPostId()->getHex() );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -426,19 +427,19 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-restored-topic',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getCreatorText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
array() );
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', array() );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return array( 'raw' => 
htmlspecialchars( $revision->getModeratedReason() ) );
                                },
                        ),
@@ -496,22 +497,22 @@
                'history' => array(
                        'i18n-message' => 'flow-rev-message-reply',
                        'i18n-params' => array(
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return Message::rawParam( 
$templating->getUserLinks( $revision, $user ) );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                        return $templating->getUserText( 
$revision, $user );
                                },
-                               function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       $data = array( $block->getName() . 
'[postId]' => $revision->getPostId()->getHex() );
-                                       return 
$templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', 
$data, 'flow-post-' . $revision->getPostId()->getHex() );
+                               function ( PostRevision $revision, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
+                                       $data = array( $blockType . '[postId]' 
=> $revision->getPostId()->getHex() );
+                                       return 
$templating->getUrlGenerator()->generateUrl( $workflowId, 'view', $data, 
'flow-post-' . $revision->getPostId()->getHex() );
                                },
                        ),
                        'class' => 'flow-history-reply',
                        'bundle' => array(
                                'i18n-message' => 
'flow-rev-message-reply-bundle',
                                'i18n-params' => array(
-                                       function ( array $revisions, Templating 
$templating, User $user, Block $block ) {
+                                       function ( array $revisions, Templating 
$templating, User $user, UUID $workflowId, $blockType ) {
                                                return array( 'num' => count( 
$revisions ) );
                                        }
                                ),
diff --git a/includes/Contributions/Formatter.php 
b/includes/Contributions/Formatter.php
index 4e675f9..51c6ff5 100644
--- a/includes/Contributions/Formatter.php
+++ b/includes/Contributions/Formatter.php
@@ -20,15 +20,9 @@
                $user = $pager->getUser();
                $title = $workflow->getArticleTitle();
 
-               // Fetch Block object
-               $block = $this->loadBlock( $title, $workflow->getId(), 
$row->blocktype );
-               if ( !$block ) {
-                       return false;
-               }
-
                // Fetch required data
                $charDiff = $this->getCharDiff( $revision, 
$row->previous_revision );
-               $description = $this->getActionDescription( $workflow, $block, 
$revision, $user );
+               $description = $this->getActionDescription( $workflow, 
$row->blocktype, $revision, $user );
                $dateFormats = $this->getDateFormats( $revision, $user, $lang );
                $links = $this->buildActionLinks(
                        $title,
diff --git a/includes/Formatter.php b/includes/Formatter.php
index db589b7..6809b91 100644
--- a/includes/Formatter.php
+++ b/includes/Formatter.php
@@ -230,7 +230,7 @@
         * @param User $user
         * @return string
         */
-       public function getActionDescription( Workflow $workflow, AbstractBlock 
$block, AbstractRevision $revision, User $user ) {
+       public function getActionDescription( Workflow $workflow, $blockType, 
AbstractRevision $revision, User $user ) {
                // Build description message, piggybacking on history i18n
                $changeType = $revision->getChangeType();
                $msg = $this->actions->getValue( $changeType, 'history', 
'i18n-message' );
@@ -239,7 +239,8 @@
                        $revision,
                        $this->templating,
                        $user,
-                       $block
+                       $workflow->getId(),
+                       $blockType
                ) )->parse();
 
                return \Html::rawElement(
@@ -262,25 +263,6 @@
                }
 
                return ChangesList::showCharacterDifference( strlen( 
$previousContent ), strlen( $revision->getContentRaw() ) );
-       }
-
-       /**
-        * @param Title $title
-        * @param UUID $workflowId
-        * @param string $name Block name (e.g. "topic", "header")
-        * @return AbstractBlock|bool Requested block or false on failure
-        */
-       protected function loadBlock( Title $title, UUID $workflowId, $name ) {
-               $loader = $this->workflowLoaderFactory
-                       ->createWorkflowLoader( $title, $workflowId );
-               $blocks = $loader->createBlocks();
-
-               if ( !isset( $blocks[$name] ) ) {
-                       wfWarn( __METHOD__ . ': Could not load block ' . $name 
. ' for workflow ' . $workflowId->getHex() );
-                       return false;
-               }
-
-               return $blocks[$name];
        }
 
        /**
diff --git a/includes/RecentChanges/Formatter.php 
b/includes/RecentChanges/Formatter.php
index 4bb2af2..4bb662a 100644
--- a/includes/RecentChanges/Formatter.php
+++ b/includes/RecentChanges/Formatter.php
@@ -42,11 +42,6 @@
                        return false;
                }
 
-               $block = $this->loadBlock( $title, $workflow->getId(), 
$changeData['block'] );
-               if ( !$block ) {
-                       return false;
-               }
-
                $links = (array) $this->buildActionLinks(
                        $title,
                        $revision->getChangeType(),
@@ -89,7 +84,7 @@
                        . ' '
                        . $this->changeSeparator()
                        . ' '
-                       . $this->getActionDescription( $workflow, $block, 
$revision, $user );
+                       . $this->getActionDescription( $workflow, 
$row->blocktype, $revision, $user );
        }
 
        protected function changeSeparator() {
diff --git a/includes/View/History/HistoryRenderer.php 
b/includes/View/History/HistoryRenderer.php
index 09769c9..6220482 100644
--- a/includes/View/History/HistoryRenderer.php
+++ b/includes/View/History/HistoryRenderer.php
@@ -42,7 +42,7 @@
         * included.
         *
         * @param History $history
-        * @return array The keys of this array are properly escaped for output 
as 
+        * @return array The keys of this array are properly escaped for output 
as
         *     raw html, the values are an associative array containing 'from' 
and
         *     'to' keys mapping to MWTimestamp objects.
         */
@@ -179,7 +179,8 @@
                                $record->getData(),
                                $this->templating,
                                $wgUser,
-                               $this->block
+                               $this->block->getWorkflowId(),
+                               $this->block->getName()
                        ),
                        'timestamp' => $record->getTimestamp(),
                        'children' => $children,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7c95ab5a0dbbc6c92822a59b0b480d2ddafabbe
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Matthias Mullie <mmul...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to