Page MenuHomePhabricator

Maintenance script to perform null edits on multiple or all pages
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):

Maintenance script to perform null edits on multiple or all pages. The current "refresh..." scripts don't do the job.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

Pages with Cargo/SMW queries, template categorisation etc.

Benefits (why should this be implemented?):

It would save people having to download third-party software like AWB or pywikibot.

Thanks for considering this.

Event Timeline

Mentioned on the Support Desk page under heading "Automatic null edits of multiple pages", currently at https://www.mediawiki.org/wiki/Project:Support_desk#Automatic_null_edits_of_multiple_pages.

The maintenance script refreshLinks.php should do the same as null edits.

purgeList.php or purgePage.php only removes the html of the page from CDN or ParserCache and let the parser regenerate it, but that does not change anything on the database.
rebuildall.php runs refreshLinks.php as well

I have a feeling that rebuildall doesn't re-parse pages, so doesn't do the same as null edits.

I have a feeling that rebuildall doesn't re-parse pages, so doesn't do the same as null edits.

rebuildall's a shortcut for rebuildtextindex, rebuildrecentchanges, and refreshLinks, from which refreshLinks does re-parse pages for derived data updates (like link table changes). This includes category changes.
What null-edits do, is invoke a derived data update and run page save hooks (and this largely differs from regular edits in that a CDN update won't be scheduled).

You've mentioned Cargo but the fact that null-edits are at all required to update Cargo data only points to Cargo being a poor quality mess (i.e. relying on a spaghetti of a save hook, global flags and a re-parse). I don't know much about SMW so can't speak on that front.

If null edits do anything unique then I think it would be good to have a maintenance script to perform null edits on multiple or all pages.

It does seem that they do something unique.

https://www.mediawiki.org/wiki/Help:Dummy_edit#Null_edit mentions:

A null edit is particularly valuable for updating category pages when categories are included via templates. Unlike purging the cache, which may not always update category contents, a null edit ensures that any changes made to templates affecting category inclusions are accurately reflected on the page.

The most useful aspect of a null edit is its ability to update category pages, particularly when categories are transcluded via templates. When a category has been added to or removed from a template since its last transclusion on a page, simply purging the cache won't update the category contents. However, executing a null edit on the page (not the category itself) accomplishes this. This behavior is evident when categories are managed through templates. See How to add a category by utilizing a template.


I don't know whether the criticism of Cargo is merited but I suspect SMW would be in the same boat. SMW has a page for null edits: https://www.semantic-mediawiki.org/wiki/Null_edit. There are third party sites relating to both extensions mentioning null edits, e.g. https://dev.fandom.com/wiki/NullEditButton (SMW) and https://support.wiki.gg/wiki/Null_edit (Cargo). @Yaron_Koren might have a view on this.

I'm not sure but I think my own problem was possibly just an error on a template (because of an extension not being compatible after MW upgrade) which meant 100s of pages got messed up including their categorisation.