Werdna has uploaded a new change for review.

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

Change subject: Only generate board HTML if generateHtml is true.
......................................................................

Only generate board HTML if generateHtml is true.

Drastically improves the speed of saving.

Change-Id: I6776a9ba621c41fc097330eb49536392a7135cb7
---
M includes/Content/BoardContent.php
1 file changed, 23 insertions(+), 21 deletions(-)


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

diff --git a/includes/Content/BoardContent.php 
b/includes/Content/BoardContent.php
index 53c762d..7d85e94 100644
--- a/includes/Content/BoardContent.php
+++ b/includes/Content/BoardContent.php
@@ -174,30 +174,32 @@
                $parserOutput = new ParserOutput();
                $parserOutput->updateCacheExpiry( 0 );
 
-               // Set up a derivative context (which inherits the current 
request)
-               // to hold the output modules + text
-               $childContext = new DerivativeContext( 
RequestContext::getMain() );
-               $childContext->setOutput( new OutputPage( $childContext ) );
-               $childContext->setRequest( new FauxRequest );
+               if ( $generateHtml ) {
+                       // Set up a derivative context (which inherits the 
current request)
+                       // to hold the output modules + text
+                       $childContext = new DerivativeContext( 
RequestContext::getMain() );
+                       $childContext->setOutput( new OutputPage( $childContext 
) );
+                       $childContext->setRequest( new FauxRequest );
 
-               // Create a View set up to output to our derivative context
-               $view = new View(
-                       Container::get('templating'), // Should this also use 
the output page? I think it's okay
-                       Container::get('url_generator'),
-                       Container::get('lightncandy'),
-                       $childContext->getOutput()
-               );
+                       // Create a View set up to output to our derivative 
context
+                       $view = new View(
+                               Container::get('templating'), // Should this 
also use the output page? I think it's okay
+                               Container::get('url_generator'),
+                               Container::get('lightncandy'),
+                               $childContext->getOutput()
+                       );
 
-               // Load workflow and run View.
-               $loader = Container::get('factory.loader.workflow')
-                       ->createWorkflowLoader( $title, $this->getWorkflowId() 
);
-               $view->show( $loader, 'view' );
+                       // Load workflow and run View.
+                       $loader = Container::get('factory.loader.workflow')
+                               ->createWorkflowLoader( $title, 
$this->getWorkflowId() );
+                       $view->show( $loader, 'view' );
 
-               // Extract data from derivative context
-               $parserOutput->setText( $childContext->getOutput()->getHTML() );
-               $parserOutput->addModules( 
$childContext->getOutput()->getModules() );
-               $parserOutput->addModuleStyles( 
$childContext->getOutput()->getModuleStyles() );
-               $parserOutput->addModuleScripts( 
$childContext->getOutput()->getModuleScripts() );
+                       // Extract data from derivative context
+                       $parserOutput->setText( 
$childContext->getOutput()->getHTML() );
+                       $parserOutput->addModules( 
$childContext->getOutput()->getModules() );
+                       $parserOutput->addModuleStyles( 
$childContext->getOutput()->getModuleStyles() );
+                       $parserOutput->addModuleScripts( 
$childContext->getOutput()->getModuleScripts() );
+               }
 
                Container::get( 'reference.updater.links-tables' )
                        ->mutateParserOutput( $title, $parserOutput );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6776a9ba621c41fc097330eb49536392a7135cb7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna <[email protected]>

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

Reply via email to