r111570 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111569‎ | r111570 | r111571 >
Date:19:53, 15 February 2012
Author:emsmith
Status:ok (Comments)
Tags:
Comment:
bug 34090 - request oversight is now a counter - so you can request/unrequest as a hider, and if you do "decline oversight" as an oversighter it will reset the count to 0
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/sql/ArticleFeedbackv5.sql (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/sql/alter.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/sql/ArticleFeedbackv5.sql
@@ -41,8 +41,9 @@
4242 af_unhelpful_count integer unsigned NOT NULL DEFAULT 0,
4343 -- Net helpfulness (helpful - unhelpful). Used in fetch query.
4444 af_net_helpfulness integer NOT NULL DEFAULT 0,
45 - -- Flag a message as requiring oversight, being hidden ,or being deleted
46 - af_needs_oversight boolean NOT NULL DEFAULT FALSE,
 45+ -- Keep track of requests for oversight on the item
 46+ af_oversight_count integer unsigned NOT NULL DEFAULT 0,
 47+ -- Flag a message as being hidden or being deleted
4748 af_is_deleted boolean NOT NULL DEFAULT FALSE,
4849 af_is_hidden boolean NOT NULL DEFAULT FALSE,
4950 -- Keep track of number of activities (hide/show/flag/unflag)
Index: trunk/extensions/ArticleFeedbackv5/sql/alter.sql
@@ -128,3 +128,4 @@
129129
130130 -- Added 2/14 (emsmith)
131131 ALTER TABLE /*_*/aft_article_feedback ADD COLUMN af_activity_count integer unsigned NOT NULL DEFAULT 0;
 132+ALTER TABLE /*_*/aft_article_feedback CHANGE COLUMN af_needs_oversight af_oversight_count integer unsigned NOT NULL DEFAULT 0;
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -362,7 +362,7 @@
363363 $.articleFeedbackv5special.flagFeedback( id, 'delete', -1, note );
364364 break;
365365 case 'declineoversight':
366 - $.articleFeedbackv5special.flagFeedback( id, 'resetdelete', 1, note );
 366+ $.articleFeedbackv5special.flagFeedback( id, 'resetoversight', 1, note );
367367 break;
368368 case 'requestoversight':
369369 $.articleFeedbackv5special.flagFeedback( id, 'oversight', 1, note );
Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php
@@ -29,8 +29,8 @@
3030 $notes = $params['note'];
3131 $direction = isset( $params['direction'] ) ? $params['direction'] : 'increase';
3232 $counts = array( 'increment' => array(), 'decrement' => array() );
33 - $counters = array( 'abuse', 'helpful', 'unhelpful' );
34 - $flags = array( 'oversight', 'hide', 'delete' );
 33+ $counters = array( 'abuse', 'helpful', 'unhelpful', 'oversight' );
 34+ $flags = array( 'hide', 'delete' );
3535 $results = array();
3636 $helpful = null;
3737 $error = null;
@@ -44,16 +44,12 @@
4545 $error = 'articlefeedbackv5-invalid-feedback-id';
4646 } elseif ( in_array( $flag, $flags ) ) {
4747
48 - $count = null;
 48+ $count = null;
4949 switch( $flag ) {
50 - case 'hide':
 50+ case 'hide':
5151 $field = 'af_is_hidden';
5252 $count = 'invisible';
5353 break;
54 - case 'oversight':
55 - $field = 'af_needs_oversight';
56 - $count = 'needsoversight';
57 - break;
5854 case 'delete':
5955 $field = 'af_is_deleted';
6056 $count = 'deleted';
@@ -65,6 +61,7 @@
6662 } else {
6763 $update[] = "$field = FALSE";
6864 }
 65+
6966 // Increment or decrement whichever flag is being set.
7067 $countDirection = $direction == 'increase' ? 'increment' : 'decrement';
7168 $counts[$countDirection][] = $count;
@@ -78,6 +75,10 @@
7976 && $direction == 'decrease' ) {
8077 $counts['increment'][] = 'visible';
8178 }
 79+ } elseif( 'resetoversight' === $flag) {
 80+ // special case, oversight request count becomes 0
 81+ $update[] = "af_oversight_count = 0";
 82+
8283 } elseif ( in_array( $flag, $counters ) ) {
8384 // Probably this doesn't need validation, since the API
8485 // will handle it, but if it's getting interpolated into
@@ -302,7 +303,7 @@
303304 ApiBase::PARAM_REQUIRED => true,
304305 ApiBase::PARAM_ISMULTI => false,
305306 ApiBase::PARAM_TYPE => array(
306 - 'abuse', 'hide', 'helpful', 'unhelpful', 'delete', 'undelete', 'unhide', 'oversight', 'unoversight' )
 307+ 'abuse', 'hide', 'helpful', 'unhelpful', 'delete', 'undelete', 'unhide', 'oversight', 'unoversight', 'resetoversight' )
307308 ),
308309 'direction' => array(
309310 ApiBase::PARAM_REQUIRED => false,
@@ -403,8 +404,13 @@
404405 return 'unrequest';
405406 }
406407
407 - // TODO: how is "decline oversight" handled?
408 - // how should fall out the bottom here be handled? a simple "feedback altered"?
 408+ // handle resetoversight
 409+ if ( 'resetoversight' == $flag) {
 410+ return 'decline';
 411+ }
 412+
 413+ // this is the default - we should never, ever get here, but just in case
 414+ return 'flag';
409415 }
410416
411417 /**
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -211,7 +211,7 @@
212212 'afi_data_type', 'af_created', 'user_name',
213213 'af_user_ip', 'af_is_hidden', 'af_abuse_count',
214214 'af_helpful_count', 'af_unhelpful_count',
215 - 'af_is_deleted', 'af_needs_oversight', 'af_revision_id',
 215+ 'af_is_deleted', 'af_oversight_count', 'af_revision_id',
216216 'af_net_helpfulness', 'af_revision_id',
217217 'page_latest', 'page_title', 'page_namespace',
218218 'rating.aa_response_boolean AS rating'
@@ -275,7 +275,7 @@
276276
277277 switch ( $filter ) {
278278 case 'needsoversight':
279 - $where[] = 'af_needs_oversight IS TRUE';
 279+ $where[] = 'af_oversight_count > 0';
280280 break;
281281 case 'id':
282282 # Used for permalinks.
@@ -416,7 +416,7 @@
417417
418418 // !can delete == request oversight
419419 if ( $can_hide && !$can_delete) {
420 - if ( $record[0]->af_needs_oversight ) {
 420+ if ( $record[0]->af_oversight_count > 0 ) {
421421 $msg = 'unoversight';
422422 $class = 'unrequestoversight';
423423 } else {
@@ -434,7 +434,7 @@
435435 if ( $can_delete ) {
436436
437437 // if we have oversight requested, add "decline oversight" link
438 - if ( $record[0]->af_needs_oversight ) {
 438+ if ( $record[0]->af_oversight_count > 0 ) {
439439 $tools .= Html::rawElement( 'li', array(), Html::element( 'a', array(
440440 'id' => "articleFeedbackv5-declineoversight-link-$id",
441441 'class' => "articleFeedbackv5-declineoversight-link",

Follow-up revisions

RevisionCommit summaryAuthorDate
r111573bug 34090 - removed the "header" portion of the html generation from the acti...emsmith20:18, 15 February 2012
r111645bug 34090 - updated the filter count update script to get requested oversight...emsmith15:45, 16 February 2012
r112038bug 34090 - added additional counts for filters including unhidden, undeleted...emsmith20:28, 21 February 2012
r112039bug 34090 - fixed issue noted : if $feedback is false return nothing - not th...emsmith20:50, 21 February 2012
r112041bug 34090 - kill the -1 issue by never letting it get below 0emsmith21:08, 21 February 2012
r112115bug 34090 - no code changes, just fixing/adding keyword svn propertiesemsmith16:31, 22 February 2012
r112119bug 34090 - cast the naughty column so it can be signed, the greatest still k...emsmith16:57, 22 February 2012
r112142bug 34090 - toggle for atomic un/helpful changing (and elimination of an extr...emsmith20:37, 22 February 2012
r112147bug 34090 - note to self, watch the copy and paste errors...emsmith21:01, 22 February 2012
r112149bug 34090 - no upper limit, only lower limit - we can't get any worse then 0emsmith21:21, 22 February 2012
r112154bug 34090 - quick and dirty helper script to get missing documentation keysemsmith21:57, 22 February 2012
r112156bug 34090 - only send the activity header if continue < 1, make the more div ...emsmith22:14, 22 February 2012
r112161bug 34090 - fix limit and use old continue to determine if we do the headeremsmith23:15, 22 February 2012
r112218bug 34090 - make sure the name are right for hidden/unhidden logging (argh)emsmith16:44, 23 February 2012
r112225bug 34090 - unhidden and unoversight logic adjustmentsemsmith18:06, 23 February 2012
r112228bug 34090 - fix filter - needsoversight are always autohiddenemsmith19:16, 23 February 2012
r112230bug 34090 - let's try this again - needsoversight and declined will have hidd...emsmith19:38, 23 February 2012
r112232bug 34090 - hide and show shouldn't fiddle with oversight counts or declined ...emsmith19:48, 23 February 2012
r112599bug 34090 - follow up to r111211 - rename things to make them "less confusin...emsmith14:43, 28 February 2012
r112603bug 34090 - Add the logging of automated hide/show errors by the "Article Fee...emsmith15:21, 28 February 2012
r112604bug 34090 - can't believe there were no permissions checks in this - only del...emsmith15:38, 28 February 2012
r112610bug 34090 - change all sql updates to use escaping except for explicitly comm...emsmith16:22, 28 February 2012
r112611bug 34090 - take out implicit show and add returning user that hid/oversighte...emsmith17:02, 28 February 2012
r112627bug 34090 - follow up to r112599 - change to use getText since it's going int...emsmith18:53, 28 February 2012
r112825bug 34090 - insert custom attributes (sigh) for the user and formatted timest...emsmith18:14, 1 March 2012
r112830bug 34090 - follow up to r111474 - use truncate for choppingemsmith19:42, 1 March 2012
r113052bug 34090 - remaining backend feature in requirements, oversight email genera...emsmith18:04, 5 March 2012
r113062bug 34090 - follow up to r110520 1. change index 2. default of null for conti...emsmith18:54, 5 March 2012
r113073bug 34090 - follow up to r111472 part 1 - change to use getDbKey, check for b...emsmith19:48, 5 March 2012
r113082bug 34090 - follow up to r111471 - changed to use text()emsmith20:42, 5 March 2012
r113083bug 34090 - follow up to rr111472 part 2 - only use log_id for orderingemsmith20:48, 5 March 2012
r113104bug 34090 - follow up to rr111472 part 3 - totally redo the continue function...emsmith23:10, 5 March 2012
r113159bug 34090 - follow up to rr111472 part 4 and follow up to r111596 (same issue...emsmith17:37, 6 March 2012
r113160bug 34090 - follow up to rr111472 part 5 plural and number format action countemsmith17:48, 6 March 2012
r113161bug 34090 - follow up to rr111472 part 6 last of lego messagesemsmith17:53, 6 March 2012
r113163bug 34090 - two additional configuration settings (help url and admin user ur...emsmith18:02, 6 March 2012
r113193bug 34090 - followup to r113104 - only sort by timestamp (sorting by log id w...emsmith22:56, 6 March 2012
r113228bug 34090 - followup to r113160emsmith14:05, 7 March 2012
r113247bug 34090 - db issue, remove one of the sorts from the query, use the ids arr...emsmith16:52, 7 March 2012
r113269bug 34090 - followup to r113247emsmith19:01, 7 March 2012
r113273bug 34090 - add javascript level hiding on request oversight IF autohidden is...emsmith19:22, 7 March 2012
r113287bug 34090 - usernames and formatted timestamps into red lines for hidden/over...emsmith20:22, 7 March 2012
r113311bug 34090 - fixing the username bugs - apparently using the data- stuff with ...emsmith22:34, 7 March 2012
r113317bug 34090 - js and css voodoo to make the element with the red lines appear a...emsmith23:01, 7 March 2012
r113370bug 34090 - make different titles for masking appear if it's been hidden or o...emsmith16:43, 8 March 2012
r113371bug 34090 - fixes for oversighter view for hide/oversight panelsemsmith17:51, 8 March 2012
r113383bug 34090 - not entirely necessary, but keeps $2 from showing up in hiders pa...emsmith19:25, 8 March 2012
r113384bug 34090 - fix for double red line issues when hiding an oversighted post ha...emsmith19:28, 8 March 2012
r113390bug 34090 - adding translation for "automatic hider" useremsmith19:44, 8 March 2012
r113392bug 34090 - followup to r113287 - adjusted localization documentationemsmith20:03, 8 March 2012
r113393bug 34090 - followup to r113370 - adjusted localization documentationemsmith20:05, 8 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111211bug 34090 - Added a log namespace and log types for the Article Feedback v5 e...emsmith22:53, 10 February 2012
r111472bug 34090 - Added an additional column in the main feedback table to keep a c...emsmith19:14, 14 February 2012
r111474bug 34090 - remove a todo - take the note from the flag submission and save i...emsmith19:57, 14 February 2012
r111552bug 34090 - split activity notes into their own config for maximum length (th...emsmith16:07, 15 February 2012
r111557bug 34090 - changed structure of the link classes and ids per the following f...emsmith16:47, 15 February 2012

Comments

#Comment by Catrope (talk | contribs)   19:42, 1 March 2012

This is OK, but it will need a feature that limits the number of oversight requests on a single feedback item, if that hasn't been done already. For instance, if oversight is requested more than 5 times, the item should be hidden 1) because it's probably controversial, same as with 5x abuse and 2) so we swamp the DB with oversight requests when someone posts a couple dozen offensive things and hundreds of people flag each of them before an oversighter arrives to the scene.

Status & tagging log