Last modified: 2012-06-15 14:33:58 UTC
The extensions UserDailyContribs seems to include null edits in its edit counts. This can be seen at [1] where the edit count for the last 180 days is larger than the total edit count for the user. I think it is caused by the ArticleSaveComplete function in UserDailyContribs.hooks.php[2]. That function updates the count without checking if any change was made. I think such checks can be made with $revision or $status of the ArticleSaveComplete hook[3]. [1] http://sv.wikipedia.org/w/api.php?action=userdailycontribs&user=ErfgoedBot&daysago=180&format=xml [2] http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/UserDailyContribs/UserDailyContribs.hooks.php?revision=91244&view=markup#l38 [3] http://www.mediawiki.org/wiki/Manual:Hooks/ArticleSaveComplete
Sounds like you could get a patch together. If you do, please submit via Gerrit.
Created attachment 10624 [details] Patch to check if a new revision is saved This patch will correct future counting. But old counts already in the database will still be incorrect.
Hi Lejonel, please request developer access (see https://www.mediawiki.org/wiki/Developer_access ) and submit your changes for review: https://www.mediawiki.org/wiki/Git/Workflow
I already attached a patch here for review
Your patch wouldn't work. $revision won't be null in a null-edit. It will be a revision object.
(In reply to comment #5) It worked on my test wiki. Documentation at mediawiki.org for ArticleSaveComplete says $revision is null if no change is made, and WikiPage.php contains: 1397 if ( !$changed ) { 1398 $status->warning( 'edit-no-change' ); 1399 $revision = null;
I can't find that text anywhere in WikiPage.php. Also, why did you add so many new parameters to articleSaveComplete?
You are right, I had missed that portion.
You're still using svn. Your working copy missed for instance https://gerrit.wikimedia.org/r/7259 Patch merged and pushed in https://gerrit.wikimedia.org/r/8018
Thanks for the patch, Lejonel! The patch has now been merged. I highly recommend you get Git access https://www.mediawiki.org/wiki/Developer_access ) and submit future changes via Gerrit: https://www.mediawiki.org/wiki/Git/Tutorial