r110425 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110424‎ | r110425 | r110426 >
Date:20:38, 31 January 2012
Author:gregchiasson
Status:ok
Tags:aft 
Comment:
AFT5: Remove the evil COUNT(*) subquery, and replace the link it was used it with something more generic, that works without the count, per discussions with Fabrice. Also fix one last instance of treating is_hidden as an int instead of a boolean (not that it mattered, but may as well be consistent). r109441
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -73,6 +73,7 @@
7474 'articlefeedbackv5-special-showing' => '{{PLURAL:$1|1 feedback post|$1 feedback posts}} on this article',
7575 'articleFeedbackv5-comment-ago' => '$1 ago',
7676 'articlefeedbackv5-updates-since' => '{{PLURAL:$1|1 edit|$1 edits}} since post',
 77+ 'articlefeedbackv5-revision-link' => 'View exact page',
7778 'articlefeedbackv5-special-more' => 'Show more posts',
7879 'articlefeedbackv5-special-pagetitle' => 'Feedback: $1',
7980 'articlefeedbackv5-form-optionid' => 'Option $1',
@@ -333,6 +334,7 @@
334335 'articlefeedbackv5-special-showing' => 'Text to show how many feedback psots have been posted to this article. $1 is the number of posts (needs plural support)',
335336 'articleFeedbackv5-comment-ago' => 'For posts less than 48 hours old, display a relative timestamp ("2 hours 19 minutes ago", eg). Formatting timestamp is in $1',
336337 'articlefeedbackv5-updates-since' => 'Number of edits made to this article since this feedback was posted. $1 is the number of edits. Requires plural support',
 338+ 'articlefeedbackv5-revision-link' => 'Link to view the exact revision this user commented on (may be the current live page, or a historical revision).',
337339 'articlefeedbackv5-special-more' => '{{Identical|More}}',
338340 'articlefeedbackv5-special-pagetitle' => 'Page title for [[Special:ArticleFeedbackv5]]. Parameters:
339341 * $1 is the title of the article for which we show the feedback',
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -185,8 +185,7 @@
186186 'afi_data_type', 'af_created', 'user_name',
187187 'af_user_ip', 'af_is_hidden', 'af_abuse_count',
188188 'af_helpful_count', 'af_unhelpful_count',
189 - 'af_is_deleted', 'af_needs_oversight',
190 - '(SELECT COUNT(*) FROM ' . $dbr->tableName( 'revision' ) . ' WHERE rev_id > af_revision_id AND rev_page = ' . ( integer ) $pageId . ') AS age',
 189+ 'af_is_deleted', 'af_needs_oversight', 'af_revision_id',
191190 'af_net_helpfulness', 'af_revision_id',
192191 'page_latest', 'page_title', 'page_namespace',
193192 'rating.aa_response_boolean AS rating'
@@ -315,18 +314,12 @@
316315 $details = Html::openElement( 'div', array(
317316 'class' => 'articleFeedbackv5-comment-details-updates'
318317 ) );
319 - if( $record[0]->age > 0 ) {
320 - $details .= Linker::link(
321 - Title::newFromRow( $record[0] ),
322 - wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age )->escaped(),
323 - array(),
324 - array(
325 - 'action' => 'historysubmit',
326 - 'diff' => $record[0]->page_latest,
327 - 'oldid' => $record[0]->af_revision_id
328 - )
329 - );
330 - }
 318+ $details .= Linker::link(
 319+ Title::newFromRow( $record[0] ),
 320+ wfMessage( 'articlefeedbackv5-revision-link' )->escaped(),
 321+ array(),
 322+ array( 'oldid' => $record[0]->af_revision_id )
 323+ );
331324 $details .= Html::closeElement( 'div' );
332325
333326 $footer_links = Html::openElement( 'div', array(
@@ -398,7 +391,7 @@
399392 ) );
400393
401394 if ( $can_hide ) {
402 - if ( $record[0]->af_is_hidden > 0 ) {
 395+ if ( $record[0]->af_is_hidden ) {
403396 $msg = 'unhide';
404397 } else {
405398 $msg = 'hide';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109441AFT5 feedback page: enable permalinks and 'edits since post' functionality. F...gregchiasson22:00, 18 January 2012

Status & tagging log