Category counter not updated on article deletion
Closed, ResolvedPublic

Description

In Article::doDeleteArticle(), the code for updating the category counters is executed after the delete on the categorylinks table, so the query

  1. Fix category table counts
		$cats = array();
		$res = $dbw->select( 'categorylinks', 'cl_to', array( 'cl_from' => $id ), __METHOD__ );

will never return a result. Thus, the category counters aren't updated at all on article deletions.


Version: unspecified
Severity: minor
URL: http://en.wikipedia.org/wiki/Category:Articles_for_deletion

bzimport added a project: MediaWiki-Categories.Via ConduitNov 21 2014, 10:27 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz17155.
P.Copp created this task.Via LegacyJan 25 2009, 9:20 PM
P.Copp added a comment.Via ConduitFeb 10 2009, 3:24 PM

Proposed fix: Move updateCategoryCounts() up a few lines

Attached: bug17155.patch

bzimport added a comment.Via ConduitFeb 16 2009, 4:55 PM

ayg wrote:

Thanks for the report. This was inexplicably broken in r41018. I reverted the bad parts of that in r47318, backported to 1.14 in r47319.

bzimport added a comment.Via ConduitFeb 16 2009, 4:58 PM

ayg wrote:

(In reply to comment #2)

bad parts of that in r47318, backported to 1.14 in r47319.

That should be r47319 and r47320 respectively.

aaron added a comment.Via ConduitFeb 16 2009, 5:58 PM

Note that r41018 only moved the step below the RC row deletion and Article::onArticleDelete( $this->mTitle ) steps. r47319 Just reverted this.

The *above* patch moves this up before the page row deletion and more importantly before:

$dbw->delete( 'categorylinks', array( 'cl_from' => $id ) );

This seems to be actually broken by r40912.

Restored in r47326

Add Comment