r109390 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109389‎ | r109390 | r109391 >
Date:16:46, 18 January 2012
Author:gregchiasson
Status:resolved (Comments)
Tags:aft 
Comment:
Fix AFT5 special page translation again - looks like it got clobbered in r109368. Also add some SQL to reload the filter_counts, though they don't update on the special page yet.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/sql/alter.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/sql/alter.sql
@@ -60,3 +60,12 @@
6161 -- added 1/16 (greg)
6262 ALTER TABLE aft_article_feedback ADD COLUMN af_helpful_count integer unsigned NOT NULL DEFAULT 0;
6363 ALTER TABLE aft_article_feedback ADD COLUMN af_delete_count integer unsigned NOT NULL DEFAULT 0;
 64+
 65+-- added 1/18 (greg)
 66+DELETE FROM aft_article_filter_count;
 67+INSERT INTO aft_article_filter_count(afc_page_id, afc_filter_name, afc_filter_count) SELECT af_page_id, 'helpful', COUNT(*) FROM aft_article_feedback WHERE af_helpful_count > 0 GROUP BY af_page_id;
 68+INSERT INTO aft_article_filter_count(afc_page_id, afc_filter_name, afc_filter_count) SELECT af_page_id, 'abuse', COUNT(*) FROM aft_article_feedback WHERE af_abuse_count = 0 GROUP BY af_page_id;
 69+INSERT INTO aft_article_filter_count(afc_page_id, afc_filter_name, afc_filter_count) SELECT af_page_id, 'invisible', COUNT(*) FROM aft_article_feedback WHERE af_hide_count > 0 GROUP BY af_page_id;
 70+INSERT INTO aft_article_filter_count(afc_page_id, afc_filter_name, afc_filter_count) SELECT af_page_id, 'visible', COUNT(*) FROM aft_article_feedback WHERE af_hide_count = 0 GROUP BY af_page_id;
 71+INSERT INTO aft_article_filter_count(afc_page_id, afc_filter_name, afc_filter_count) SELECT af_page_id, 'all', COUNT(*) FROM aft_article_feedback GROUP BY af_page_id;
 72+INSERT INTO aft_article_filter_count(afc_page_id, afc_filter_name, afc_filter_count) SELECT af_page_id, 'comment', COUNT(*) FROM aft_article_feedback, aft_article_answer WHERE af_id = aa_feedback_id AND aa_response_text IS NOT NULL GROUP BY af_page_id;
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -93,7 +93,7 @@
9494 'articlefeedbackv5-discussion-page' => 'Discussion',
9595 'articlefeedbackv5-whats-this' => 'Help',
9696 'articlefeedbackv5-invalid-page-id' => 'Invalid page ID',
97 - 'articlefeedbackv5-percent-found' => ' of users found what they were looking for.', // TODO: yeah, i know this is awful.
 97+ 'articlefeedbackv5-percent-found' => '<span class="stat-marker positive">$1%</span> of users found what they were looking for.',
9898 'articlefeedbackv5-overall-rating' => 'Rating: $1/5',
9999 'articlefeedbackv5-special-title' => '==Feedback==',
100100 'articlefeedbackv5' => 'Article feedback dashboard',
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php
@@ -98,7 +98,7 @@
9999 'div',
100100 array( 'id' => 'articleFeedbackv5-percent-found-wrap' )
101101 )
102 - . $this->msg( 'articlefeedbackv5-percent-found', $found )->escaped()
 102+ . $this->msg( 'articlefeedbackv5-percent-found', $found ) # Can't escape this, need the <span> tag to parse.
103103 . Html::closeElement( 'div' )
104104 . Html::element(
105105 'a',

Follow-up revisions

RevisionCommit summaryAuthorDate
r109971ATF5 - fix image links on sort arrows, and a couple of the queries for buildi...gregchiasson00:28, 25 January 2012
r110069AFT5 - explicitly declare this as plain, per comments on r109390gregchiasson19:41, 26 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109368Development of feedback page style sheet.seanheavey15:18, 18 January 2012

Comments

#Comment by Catrope (talk | contribs)   01:55, 26 January 2012
+INSERT INTO aft_article_filter_count(afc_page_id, afc_filter_name, afc_filter_count) SELECT af_page_id, 'abuse', COUNT(*) FROM aft_article_feedback WHERE af_abuse_count = 0 GROUP BY af_page_id;

Is this semantically correct? It seems weird to count the rows with abuse count equals zero and call that the number of abuse entries.

+				. $this->msg( 'articlefeedbackv5-percent-found', $found ) # Can't escape this, need the <span> tag to parse.

Sure, but don't use implicit stringification of Message objects, explicitly use ->plain() here (or ->text() if the translations need to use PLURAL).

#Comment by Gregchiasson (talk | contribs)   19:47, 26 January 2012

Former is fixed in r109971 (which I didn't associate until just now), and the latter in r110069.

Status & tagging log