http://www.mediawiki.org/wiki/Special:Code/MediaWiki/92016
Revision: 92016 Author: ashley Date: 2011-07-12 22:40:28 +0000 (Tue, 12 Jul 2011) Log Message: ----------- SocialProfile: fix epic fail times two from r84803. Thanks to Skizzerz for the help with that "catchable fatal error" and info on how to fix it. TODO: this code might be more appropriate in the Comments extension Modified Paths: -------------- trunk/extensions/SocialProfile/UserStats/UserStatsClass.php Modified: trunk/extensions/SocialProfile/UserStats/UserStatsClass.php =================================================================== --- trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2011-07-12 22:35:43 UTC (rev 92015) +++ trunk/extensions/SocialProfile/UserStats/UserStatsClass.php 2011-07-12 22:40:28 UTC (rev 92016) @@ -366,20 +366,20 @@ $commentIDs = $dbw->select( 'Comments', 'CommentID', - array( 'Comment_user_id' => $voteType ), + array( 'Comment_user_id' => $this->user_id ), __METHOD__ ); $ids = array(); foreach ( $commentIDs as $commentID ) { - $ids[] = $commentID; + $ids[] = $commentID->CommentID; } - $comments = $dbw->select( + $comments = $dbw->selectField( 'Comments_Vote', 'COUNT(*) AS CommentVoteCount', array( - 'Comment_Vote_ID IN ' . implode( ',', $ids ), + 'Comment_Vote_ID IN (' . implode( ',', $ids ) . ')', 'Comment_Vote_Score' => $voteType ), __METHOD__ @@ -387,7 +387,7 @@ $res = $dbw->update( 'user_stats', - array( $columnName => $comments->CommentVoteCount ), + array( $columnName => $comments ), array( 'stats_user_id' => $this->user_id ), __METHOD__ ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs