From 9ba4ef269d9ea1adc016cbc83e58aef1be45b6f9 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Thu, 21 Feb 2013 17:32:12 -0800 Subject: [PATCH] Only update the cache on cache miss Change I9b1d68c4faa8d177d8d0088fa1a5879caed4f1fe added an indiscriminant call to writeCache(). I assume that it was supposed to be regulated by the check for $this->isRecall() (which is a getter for '$this->recall'), but there was no concomitant change to ensure that recall is set true on cache hits. My fix does not set recall to true. The style of "pass-by-attribute" is tricky and should be factored out by a subsequent change. This change moves the call to writeCache() so that it is only called on cache miss. Change-Id: I9b690e55001859c97fd40330272791d49ec6de75 --- Math.hooks.php | 1 - MathTexvc.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Math.hooks.php b/Math.hooks.php index a70da28..f8e4656 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -55,7 +55,6 @@ class MathHooks { if ( $wgUseMathJax && $mode == MW_MATH_MATHJAX ) { $parser->getOutput()->addModules( array( 'ext.math.mathjax.enabler' ) ); } - $renderer->writeCache(); return $wgContLang->armourMath( $renderedMath ); } diff --git a/MathTexvc.php b/MathTexvc.php index 97ccd27..8b4f877 100644 --- a/MathTexvc.php +++ b/MathTexvc.php @@ -34,6 +34,7 @@ class MathTexvc extends MathRenderer { if ( $result != MW_TEXVC_SUCCESS ) { return $result; } + $this->writeCache(); } return $this->doHTMLRender(); }