Bug 31445: "Section edit links do not show"
authorPlatonides <platonides@users.mediawiki.org>
Fri, 7 Oct 2011 20:50:10 +0000 (20:50 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Fri, 7 Oct 2011 20:50:10 +0000 (20:50 +0000)
Always generate the mw:editsection placeholders.
Remove them if not used.
Update the ParserOutput if fetching from ParserCache

includes/parser/Parser.php
includes/parser/ParserCache.php

index b5aabb5..dc7e01a 100644 (file)
@@ -4140,7 +4140,7 @@ class Parser {
                        );
 
                        # give headline the correct <h#> 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()
index ec780cb..2c02d5d 100644 (file)
@@ -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" );