r99250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99249‎ | r99250 | r99251 >
Date:20:50, 7 October 2011
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
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:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -4140,7 +4140,7 @@
41414141 );
41424142
41434143 # give headline the correct <h#> tag
4144 - if ( $showEditLink && $sectionIndex !== false ) {
 4144+ if ( $sectionIndex !== false ) {
41454145 // Output edit section links as markers with styles that can be customized by skins
41464146 if ( $isTemplate ) {
41474147 # Put a T flag in the section identifier, to indicate to extractSections()
Index: trunk/phase3/includes/parser/ParserCache.php
@@ -177,6 +177,11 @@
178178 }
179179
180180 wfDebug( "Found.\n" );
 181+
 182+ // The edit section preference may not be the appropiate one in
 183+ // the ParserOutput, as we are not storing it in the parsercache
 184+ // key. Force it here. See bug 31445.
 185+ $value->setEditSectionTokens( $popts->getEditSection() );
181186
182187 if ( !$useOutdated && $value->expired( $touched ) ) {
183188 wfIncrStats( "pcache_miss_expired" );

Follow-up revisions

RevisionCommit summaryAuthorDate
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
r99265MFT r99250,r99252,r99254:...aaron21:34, 7 October 2011
r100379REL1_18 MFT r99135, r99136, r99138, r99154, r99172, r99250, r99252, r99254, r...reedy21:22, 20 October 2011
r100756If the page contains __NOEDITSECTION__, it will never have edit sections, so ...platonides22:18, 25 October 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   20:57, 7 October 2011

This outputs <mw:sectionedit> tags on printable view, seems to repeat the section name in headings.

#Comment by VitaliyFilippov (talk | contribs)   12:13, 24 February 2012

This causes Bug 34687

Status & tagging log