r99265 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99264‎ | r99265 | r99266 >
Date:21:34, 7 October 2011
Author:aaron
Status:ok
Tags:
Comment:
MFT r99250,r99252,r99254:
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
Modified paths:
  • /branches/wmf/1.18wmf1/includes/parser/Parser.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/parser/ParserCache.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/parser/ParserOutput.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/parser/Parser.php
@@ -4017,7 +4017,7 @@
40184018 );
40194019
40204020 # give headline the correct <h#> tag
4021 - if ( $showEditLink && $sectionIndex !== false ) {
 4021+ if ( $sectionIndex !== false ) {
40224022 // Output edit section links as markers with styles that can be customized by skins
40234023 if ( $isTemplate ) {
40244024 # Put a T flag in the section identifier, to indicate to extractSections()
Index: branches/wmf/1.18wmf1/includes/parser/ParserOutput.php
@@ -158,6 +158,8 @@
159159 if ( $this->mEditSectionTokens ) {
160160 return preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
161161 array( &$this, 'replaceEditSectionLinksCallback' ), $this->mText );
 162+ } else {
 163+ return preg_replace( ParserOutput::EDITSECTION_REGEX, '', $this->mText );
162164 }
163165 return $this->mText;
164166 }
Index: branches/wmf/1.18wmf1/includes/parser/ParserCache.php
@@ -174,6 +174,11 @@
175175 }
176176
177177 wfDebug( "Found.\n" );
 178+
 179+ // The edit section preference may not be the appropiate one in
 180+ // the ParserOutput, as we are not storing it in the parsercache
 181+ // key. Force it here. See bug 31445.
 182+ $value->setEditSectionTokens( $popts->getEditSection() );
178183
179184 if ( !$useOutdated && $value->expired( $touched ) ) {
180185 wfIncrStats( "pcache_miss_expired" );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99250Bug 31445: "Section edit links do not show"...platonides20:50, 7 October 2011
r99252Forgot to commit this file in r99250.platonides21:00, 7 October 2011
r99254We don't need anything from the marker. The title is outside.platonides21:05, 7 October 2011

Status & tagging log