From 4d065bb19fdf29f1d390975ba8505d4e603ca239 Mon Sep 17 00:00:00 2001 From: Platonides Date: Fri, 7 Oct 2011 20:50:10 +0000 Subject: [PATCH] Bug 31445: "Section edit links do not show" Always generate the mw:editsection placeholders. Remove them if not used. Update the ParserOutput if fetching from ParserCache --- includes/parser/Parser.php | 2 +- includes/parser/ParserCache.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index b5aabb5b3a..dc7e01a1d5 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4140,7 +4140,7 @@ class Parser { ); # give headline the correct tag - if ( $showEditLink && $sectionIndex !== false ) { + if ( $sectionIndex !== false ) { // Output edit section links as markers with styles that can be customized by skins if ( $isTemplate ) { # Put a T flag in the section identifier, to indicate to extractSections() diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index ec780cb392..2c02d5d9b0 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -177,6 +177,11 @@ class ParserCache { } wfDebug( "Found.\n" ); + + // The edit section preference may not be the appropiate one in + // the ParserOutput, as we are not storing it in the parsercache + // key. Force it here. See bug 31445. + $value->setEditSectionTokens( $popts->getEditSection() ); if ( !$useOutdated && $value->expired( $touched ) ) { wfIncrStats( "pcache_miss_expired" ); -- 2.20.1