[Mediawiki-l] Adjust article content without modifying page_touched

Brion Vibber brion at pobox.com
Thu Oct 20 23:20:59 UTC 2011


On Thu, Oct 20, 2011 at 3:36 PM, Zach H. <luckenbach at gmail.com> wrote:

> So we are currently using the MediaWiki software to run a Knowledge base
> system and have a policy that says we will review ALL articles that have
> not
> been touched in 365 days to ensure they are still relevant. Coming up with
> the SQL code to find these was very easy, one feature I was asked
> to implement was 'is it possible to add a "outdated" tag to a article' so I
> added the {{outdated}} tag to the wiki, now the hard part is, how do
> I programmatically update the most current revision without adjusting the
> page_touched date? is it even possible? I know I can do this via SQL but
> that is VERY kludgy and I can see all sorts of issues this could cause so I
> wanted to ask the pro's.
>

Well, that would kinda defeat the purpose of page_touched, which is to
provide a cache invalidation timestamp when something that would change the
rendering of the page changes, such as content, creation or deletion of
linked pages & images, etc.

Note that page_touched can be updated for many reasons other than the page
being edited; all the things above and more, including someone running
?action=purge on the page.

page_touched is not a suitable proxy for something like "has not been edited
since time X".


If what you want is to show a special header on the page when viewing it and
it hasn't been edited in X days, then you probably want something like this:

* hook into one of the various output-related methods to add things to
output before the top of the page
* calculate age-since-editing against the current version's rev_timestamp
(not page_touched!)
* output or don't output something, based on that


If you really want to edit the pages to add a template to them, then you
should probably follow the sensible logic that this counts as an edit --
that gets the page out of your hair until the next time you look for
unedited pages? And you'd want to make sure you don't add it over and over
again, etc.

-- brion


More information about the MediaWiki-l mailing list