Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/131458

Change subject: Don't call AbstractRevision::getContent unless when needed
......................................................................

Don't call AbstractRevision::getContent unless when needed

Also changing the post content to an error message when it failed to load from
Parsoid.

As suggested in 
https://gerrit.wikimedia.org/r/#/c/127666/5/includes/Templating.php

Change-Id: I70f86fec30237e00e4126ff0c50c8328de814c8c
---
M includes/Templating.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/58/131458/1

diff --git a/includes/Templating.php b/includes/Templating.php
index 55cae56..04620af 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -460,8 +460,6 @@
         */
        public function getContent( AbstractRevision $revision, $format = 
'html' ) {
                if ( $this->permissions->isAllowed( $revision, 'view' ) ) {
-                       $content = $revision->getContent( $format );
-
                        // html format
                        if ( $format === 'html' ) {
                                // Parsoid doesn't render redlinks & doesn't 
strip bad images
@@ -470,9 +468,12 @@
                                } catch ( \Exception $e ) {
                                        wfDebugLog( 'Flow', __METHOD__ . ': 
Failed fix content for rev_id = ' . 
$revision->getRevisionId()->getAlphadecimal() );
                                        \MWExceptionHandler::logException( $e );
+
+                                       $content = wfMessage( 
'flow-stub-post-content' )->parse();
                                }
                        // wikitext format
                        } else {
+                               $content = $revision->getContent( $format );
                                $content = htmlspecialchars( $content );
                        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70f86fec30237e00e4126ff0c50c8328de814c8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>

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

Reply via email to