Fix regression clearing lints on page deletion

This had previously been fixed in
I2610b9b16d4032b0e18b3537cc9ed51bfdaff299 but a poor refactoring in
Ib3d3622144b670ebe1a4ce04e6db6811584d42c8 reintroduced it.

Bug: T363682
Change-Id: I378e802753c4284e7c5ec65148b43e0b41784cf3
This commit is contained in:
Arlo Breault 2024-05-04 14:53:17 +03:00
parent 4f6729d1a0
commit 96d3f6814c

View file

@ -119,11 +119,14 @@ class Hooks implements
* @param array &$updates
*/
public function onWikiPageDeletionUpdates( $wikiPage, $content, &$updates ) {
$updates[] = new MWCallableUpdate( function () use ( $wikiPage ) {
// The article id of the title is set to 0 when the page is deleted so
// capture it before creating the callback.
$id = $wikiPage->getId();
$ns = $wikiPage->getNamespace();
$updates[] = new MWCallableUpdate( function () use ( $id, $ns ) {
$this->totalsLookup->updateStats(
$this->database->setForPage(
$wikiPage->getId(), $wikiPage->getNamespace(), []
)
$this->database->setForPage( $id, $ns, [] )
);
}, __METHOD__ );
}