MediaWiki r86534 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r86533‎ | r86534 (on ViewVC)‎ | r86535 >
Date:19:43, 20 April 2011
Author:bawolff
Status:resolved (Comments)
Tags:
Comment:
(bug 23816) Add tracking category for any page with a broken image.

Note this considers a link to a non-existent image to be broken. A link
to an image that exists but does not have a handler is not considered broken.
Modified paths:

Diff [purge]

Loading diff…

Sign-offs

UserFlagDate
Happy-meloninspected12:00, 15 May 2011

Follow-up revisions

Rev.Commit summaryAuthorDate
r95171Follow-up r86534 - Do not add tracking categories if we're looking at a speci...bawolff18:46, 21 August 2011
r107623(bug 31469) Make sure tracking category messages expand variables like...bawolff06:44, 30 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   19:49, 20 April 2011

Should it be called missing images/files then?

#Comment by Bawolff (talk | contribs)   20:41, 20 April 2011

It could be, but it doesn't add the category when you just link to a missing file - [[:file:non-existent.jpg]], you actually have to try to include it [[file:non-existent.jpg]] before the cat is added. I personally like broken better, but either works.

#Comment by Peachey88 (talk | contribs)   01:35, 21 April 2011

Pointless reply so I get followups

#Comment by Brion VIBBER (talk | contribs)   01:01, 15 June 2011

Looks ok.

#Comment by Aaron Schulz (talk | contribs)   04:19, 15 June 2011

Showing up on special:contributions on my wiki. Likely due to broken icon in contribs bar, e.g. "WikiSysop: Subpages · User rights · Edit count · SUL accounts · Global contributions").

#Comment by Bawolff (talk | contribs)   17:42, 15 June 2011

Why would there be a broken icon in the contribs bar of your wiki?

#Comment by Aaron Schulz (talk | contribs)   17:43, 15 June 2011

The bar was imported from MW.org, but absent the file. In any case, the category should only be for pages and should be based on the page content, not UI msgs.

#Comment by Bawolff (talk | contribs)   17:54, 15 June 2011

This is a larger issue with MediaWiki though. If you put __NOINDEX__ or [[category:Foo]] on MediaWiki:Sp-contributions-footer - The relavent categories will appear on special:contributions.

#Comment by Bawolff (talk | contribs)   17:23, 21 August 2011

So it would seem to make sense to disable all categories on special pages (aka things that use $wgOut->addWikiText and friends which as far as I can tell is only special pages).

Proposed fix (this is to the function OutputPage::addWikiTextTitle):

Index: includes/OutputPage.php
===================================================================
--- includes/OutputPage.php	(revision 95155)
+++ includes/OutputPage.php	(working copy)
@@ -1375,6 +1375,9 @@
 
 		$popts->setTidy( $oldTidy );
 
+		# Don't want categories in message pages to affect
+		# special pages and the like.
+		$parserOutput->setCategoryLinks( array() );
 		$this->addParserOutput( $parserOutput );
 
 		wfProfileOut( __METHOD__ );

I'm not 100% sure if that's sane, but seems the best solution to me. Thoughts?

#Comment by Bawolff (talk | contribs)   18:47, 21 August 2011

Instead of doing that, just made the parser check namespace when adding a tracking category in r95171.

resetting to new

Status & tagging log

  • 23:11, 22 August 2011 Catrope (talk | contribs) changed the status of r86534 [removed: new added: resolved]
  • 18:47, 21 August 2011 Bawolff (talk | contribs) changed the status of r86534 [removed: fixme added: new]
  • 04:19, 15 June 2011 Aaron Schulz (talk | contribs) changed the status of r86534 [removed: ok added: fixme]
  • 01:01, 15 June 2011 Brion VIBBER (talk | contribs) changed the status of r86534 [removed: new added: ok]