mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-23 15:36:52 +00:00
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:
parent
4f6729d1a0
commit
96d3f6814c
|
@ -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__ );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue