2

Is it possible to force MediaWiki update a certain Category:XXX page? For example, a lot of pages used templates that referred a category "Templates" causing every such page to be included to the "Template" category. That's obviously wrong. I have already fixed the templates by wrapping the "Templates" category into the noinclude tag, so now every page that use these templates are no longer categorized as "Templates". That's fine.

Article source:
    {{stub}}

Template source BEFORE the fix:
    This page is a stub
    [[Category:Templates]]
Rendered article BEFORE the fix:
    This page is a stub
    Categories: Templates | Stubs
Category Templates BEFORE the fix:
    Article
    Template:Stub

Template source AFTER the fix:
    This page is a stub
    <noinclude>[[Category:Templates]]</noinclude>
Rendered article AFTER the fix:
    This page is a stub
    Categories: Stubs
Category Templates AFTER the fix:
    Article <--- this is wrong
    Template:Stub

But the list in the Category:Template seems to be frozen for really long time. I do remember that I had a similar case a half year ago, and I clearly watched the number of pages decreased slowly, but constantly. Now it got stuck. Is any categorization update status page available? (I'm almost sure that I remember someone told me it's performed by a background job) Or what am I doing wrong?

  • MediaWiki: 1.23.6
  • PHP: 5.4.38

Thanks in advance.


UPDATE: See here for more information in addition to the best answer here.

  • Are you sure you set up the job queue? – Nemo Oct 14 '15 at 21:12
  • @Nemo I had not the hosting account at the time, and had no opportunity to configure like that. However, I bet I worked before I asked the question. – Lyubomyr Shaydariv Oct 15 '15 at 7:00
  • 1 year later: "it worked", of course. :) – Lyubomyr Shaydariv Oct 3 '16 at 18:56
2

I have two suggestions to try:

Purge

It looks like the update is showing on the article but not the category page, so a simple purge may do the trick.

To do that, pass the action=purge parameter to the category URL. (An easy way is to click the edit link to open the edit window, and replace action=edit with action=purge in the URL.)

Null edit

If the article is not updating after changing the template, your problem is the job queue, which can take a while to filter through, depending on load. On a case-by-case basis, performing a null edit on the article should solve your problem. From Meta-Wiki:

The most useful side-effect of a null edit is that it updates category pages, taking into account categories transcluded via templates. If a category has been added to or removed from a template since it was last transcluded on a page, then purging the cache will not update the category contents, but a null edit to the page (not the category) will – see Help:Category#Adding a category by using a template.

To do that, edit the article in question but make no changes. If you save the page, it will look like nothing happened (nothing is recorded in the page history or your contributions list), but that bypasses the job queue and forces the page to update based on the new version of the template.

  • Wow, really nice answer! Thanks for the suggestions! It's all strange. Purging had no effect at all, unfortunately. Null edit really does the trick, but it seems that I have to null-edit every page and that's tedious. I have just null-edited on article, and, true, the number of the pages in the article has decreased by one. Is there a way to force the update for the rest? For curiosity sake, I've also checked api.php?action=query&meta=siteinfo&siprop=statistics&format=jsonfm as told in the job queue article, and the number of jobs is constantly big: 1577. It looks weird to me. – Lyubomyr Shaydariv Mar 22 '15 at 22:22
  • @LyubomyrShaydariv Hmm, that is strange. How long was it between when you edited the template and when you null edited the pages? – NinjaBearMonkey Mar 22 '15 at 22:30
  • About 8 hours -- nothing changed. I'm also trying to null-edit following your suggestion, and noticed that some null-edit pages do not trigger the category to update. Can't see what is different between the changed and the unchanged pages. (The only difference I guess is the size of the pages and the number of templates used on these pages -- these pages are relatively large and use up to 15-20 templates per page). – Lyubomyr Shaydariv Mar 22 '15 at 22:34
  • Yes, I suspect it has something to do with template limits. – NinjaBearMonkey Mar 22 '15 at 22:44
  • Sorry, I was wrong in my previous comment: the null-edit seems to work always. The unaffected pages still have templates with the category. I just didn't notice it. But I'm not yet sure... – Lyubomyr Shaydariv Mar 22 '15 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.