Last modified: 2011-12-13 15:26:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18979, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16979 - Tracking category for __NOINDEX__
Tracking category for __NOINDEX__
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
All All
: Normal minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks: 14685 17004 33033
  Show dependency treegraph
Reported: 2009-01-11 22:25 UTC by Happy-melon
Modified: 2011-12-13 15:26 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Proposed patch (903 bytes, patch)
2009-01-13 11:23 UTC, jopiswezggzmw
Define category names (1.10 KB, patch)
2009-01-13 11:28 UTC, jopiswezggzmw
Proposed patch (2.56 KB, patch)
2009-01-13 23:35 UTC, jopiswezggzmw
Factoring in ArticleRobotPolicies (2.69 KB, patch)
2009-01-14 01:21 UTC, jopiswezggzmw
Proposed patch v4 (4.07 KB, patch)
2009-01-20 11:41 UTC, jopiswezggzmw
New patch (4.20 KB, patch)
2009-05-12 02:20 UTC, jopiswezggzmw

Description Happy-melon 2009-01-11 22:25:32 UTC
For transparency, pages using the __NOINDEX__ and __INDEX__ behavior switches should be auto-categorised into a tracking category a la [[Category:Hidden categories]] for __HIDDENCAT__.  Ideally, this should only occur when the switch is actually having an *effect* - ie, only where the switch is allowed by $wgNamespaceRobotPolicies and $wgArticleRobotPolicies. This would achieve the double purpose of allowing users to see if the switch is having an effect, and allowing the use of the switches to be monitored.
Comment 1 jopiswezggzmw 2009-01-13 11:23:15 UTC
Created attachment 5667 [details]
Proposed patch

I've taken a stab at trying to do this. __INDEX__ includes the page in [[Category:Indexed pages]] and __NOINDEX__ includes the page in [[Category:Non-indexed pages]].
Comment 2 jopiswezggzmw 2009-01-13 11:28:24 UTC
Created attachment 5668 [details]
Define category names
Comment 3 Happy-melon 2009-01-13 11:47:45 UTC
This categorises even if the action of __INDEX__/__NOINDEX__ is disabled by $wgExemptFromUserRobotsControl, doesn't it? From the fixmes in OutputPage.php, looks like the whole thing could do with an overhaul. 
Comment 4 jopiswezggzmw 2009-01-13 23:35:35 UTC
Created attachment 5674 [details]
Proposed patch

New patch checks if the namespace is ExemptFromUserRobotsControl.

If it is then Parser.php does not add the category or setIndexPolicy, which (I think) makes the check on OutputPage.php redundant.
Comment 5 jopiswezggzmw 2009-01-14 01:21:18 UTC
Created attachment 5675 [details]
Factoring in ArticleRobotPolicies

I could kill two birds with one stone here.

It should now work like this;

1) Check if the page has a policy defined in $wgArticleRobotPolicies - if it does not code will be executed so the page will not be added to the category and the new Index/Noindex policy will not be set.

2) If not then check $wgExemptFromUserRobotsControl - if the namespace has a local policy then the policy will not be set.

3) If not, check if NOINDEX/INDEX tags are in use

4) If so then add it to the appropriate category and set the policy.

This is the first time I've really played around with MediaWiki's code so I don't know if it will work as intended but this should also solve the problem of NOINDEX/INDEX overriding a policy set in $wgArticleRobotPolicies.
Comment 6 jopiswezggzmw 2009-01-20 11:41:47 UTC
Created attachment 5710 [details]
Proposed patch v4

Tidied up the code a little.
Comment 7 jopiswezggzmw 2009-05-12 02:20:27 UTC
Created attachment 6108 [details]
New patch

Some improvements
Comment 8 Roan Kattouw 2009-05-12 09:09:25 UTC
Wouldn't it be a better idea to track this stuff in the page_props table, like we do with __HIDDENCAT__ ?
Comment 9 jopiswezggzmw 2009-05-12 10:04:19 UTC
__HIDDENCAT__ also adds the page to [[Category:Hidden categories]].
Comment 10 Happy-melon 2009-05-12 17:00:48 UTC
*YES*.  This is the *perfect* solution. The situation is very similar, it's a 'property' that applies to individual pages that can be stored coherently in the page_props table, and the db query can be done in OutputPage.php rather than the parser.  Is [[Category:Hidden categories]] populated 'normally', with links in the categorylinks table?  Or is it generated entirely from page_props?  There's probably no reason why a [[Category:Noindexed pages]] can't be dynamically-generated; it would additionally allow the categorisation to be filtered by __NOINDEX__ tags that are functional (are suppressing indexing) and those that are not (ie are being overridden by other policies).  This would make resolving bug14900 very much easier, as well.  Great idea, Roan!
Comment 11 jopiswezggzmw 2009-05-12 20:52:58 UTC
[[Category:Hidden categories]] is populated using the categorylinks table. My patch resolves bug14900 anyway (if the page is in $wgArticleRobotPolicies then NOINDEX/INDEX have no effect) but perhaps using page_props would be better.
Comment 12 Happy-melon 2009-09-20 22:14:46 UTC
done in r56688.

Note You need to log in before you can comment on or make changes to this bug.