From 0c0c0eff81fe8367c7ec431651440d9312871df9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 14 Jan 2007 10:55:23 +0000 Subject: [PATCH] Temporary(?) optimization; only update templatelinks on view if the page has cascading restrictions. --- includes/Article.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Article.php b/includes/Article.php index 3a5ee31b18..ed7746d3ea 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2829,7 +2829,13 @@ class Article { $parserCache->save( $parserOutput, $this, $wgUser ); } - if ( !wfReadOnly() ) { + if ( !wfReadOnly() && $this->mTitle->areRestrictionsCascading() ) { + // templatelinks table may have become out of sync, + // especially if using variable-based transclusions. + // For paranoia, check if things have changed and if + // so apply updates to the database. This will ensure + // that cascaded protections apply as soon as the changes + // are visible. # Get templates from templatelinks $id = $this->mTitle->getArticleID(); -- 2.20.1