mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-23 23:44:17 +00:00
Merge "Use normal lint error updating logic for page deletions"
This commit is contained in:
commit
13dfbf4ee9
|
@ -81,10 +81,12 @@ class Hooks {
|
|||
public static function onWikiPageDeletionUpdates( WikiPage $wikiPage,
|
||||
Content $content, array &$updates
|
||||
) {
|
||||
$id = $wikiPage->getId();
|
||||
$updates[] = new MWCallableUpdate( function () use ( $id ) {
|
||||
$database = new Database( $id );
|
||||
$database->setForPage( [] );
|
||||
$title = $wikiPage->getTitle();
|
||||
$updates[] = new MWCallableUpdate( function () use ( $title ) {
|
||||
$job = new RecordLintJob(
|
||||
$title, [ 'errors' => [] ]
|
||||
);
|
||||
$job->run();
|
||||
}, __METHOD__ );
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,9 @@ class RecordLintJob extends Job {
|
|||
}
|
||||
|
||||
public function run() {
|
||||
if ( $this->title->getLatestRevID() != $this->params['revision'] ) {
|
||||
if ( isset( $this->params['revision'] )
|
||||
&& $this->title->getLatestRevID() != $this->params['revision']
|
||||
) {
|
||||
// Outdated now, let a later job handle it
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue