Last modified: 2014-09-23 23:42:49 UTC
I noticed that using section edit links the pages can get really messy when using deep sectioning. So i made a small patch to MediaWiki 1.5.0 (i checked that CVS didn't have this feature yet either) to disable section links according to a set level. With this patch you set $wgEditSectionLevel to section level that you wish to have section edit links and everything under that level. Makes some pages much clearer to read. I wasn't sure where i should submit this patch to get reviewed and maybe added to MediaWiki so i submitted it here. Couldn't come to the IRC channel because i'm at work right now. Here is the patch: --- includes/Parser.php.orig 2005-09-18 04:21:39.000000000 +0300 +++ includes/Parser.php 2005-10-24 11:14:39.000000000 +0300 @@ -2644,10 +2644,13 @@ if ( empty( $head[$headlineCount] ) ) { $head[$headlineCount] = ''; } - if( $istemplate ) - $head[$headlineCount] .= $sk->editSectionLinkForOther($templatetitle, $templatesection); - else - $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1); + global $wgEditSectionLevel; + if ( $wgEditSectionLevel == 0 || $level <= $wgEditSectionLevel ) { + if( $istemplate ) + $head[$headlineCount] .= $sk->editSectionLinkForOther($templatetitle, $templatesection); + else + $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1); + } } # give headline the correct <h#> tag
Sorry, should have included the patch as an attachment.
Created attachment 1017 [details] The same patch as in description.
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Adding the "need-review" keyword for patches that need review by developers. Väinö Järvelä, thank you for your patch, and sorry it's taken so long for a response on this! Do you still run into the problem that occasioned this bug report and fix, or has it been resolved in subsequent versions of MediaWiki?
Created attachment 10462 [details] Modernized patch Here's how it should look on modern MW, bar parser tests. The question here is whether this feature has enough demand to warrant its inclusion? Comments are welcome, probably worth a wikitech-l discussion.
Max: Could you put that patch into Gerrit?