r100808 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100807‎ | r100808 | r100809 >
Date:14:44, 26 October 2011
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
1.18wmf1: MFT r100806
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/ArticleFeedback.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/SpecialArticleFeedback.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/api/ApiArticleFeedback.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/populateAFRevisions.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/sql/AddRevisionsTable.sql (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedback/sql/ArticleFeedback.sql (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/SpecialArticleFeedback.php
@@ -507,19 +507,11 @@
508508 }
509509
510510 protected static function getCategories() {
511 - global $wgArticleFeedbackRatings;
 511+ global $wgArticleFeedbackRatingTypes;
512512
513513 if ( !isset( self::$categories ) ) {
514 - $dbr = wfGetDB( DB_SLAVE );
515 - $res = $dbr->select(
516 - 'article_feedback_ratings',
517 - array( 'aar_id', 'aar_rating' ),
518 - array( 'aar_id' => $wgArticleFeedbackRatings ),
519 - __METHOD__
520 - );
521 - self::$categories = array();
522 - foreach ( $res as $row ) {
523 - self::$categories[$row->aar_id] = wfMsg( $row->aar_rating );
 514+ foreach ( $wgArticleFeedbackRatingTypes as $id => $rating ) {
 515+ self::$categories[$id] = wfMsg( $rating );
524516 }
525517 }
526518 return self::$categories;
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/sql/AddRevisionsTable.sql
@@ -4,7 +4,7 @@
55 afr_page_id integer unsigned NOT NULL,
66 -- Revision that totals are relevant to
77 afr_revision integer unsigned NOT NULL,
8 - -- Foreign key to article_feedback_ratings.aar_rating
 8+ -- Rating ID, mapped to a name in $wgArticleFeedbackRatingTypes
99 afr_rating_id integer unsigned NOT NULL,
1010 -- Sum (total) of all the ratings for this article revision
1111 afr_total integer unsigned NOT NULL,
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/sql/ArticleFeedback.sql
@@ -1,16 +1,3 @@
2 -CREATE TABLE IF NOT EXISTS /*_*/article_feedback_ratings (
3 - -- Rating Id
4 - aar_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
5 - -- Text (i18n key) for rating description
6 - aar_rating varbinary(255) NOT NULL
7 -) /*$wgDBTableOptions*/;
8 -
9 -INSERT INTO /*_*/article_feedback_ratings (aar_rating) VALUES
10 -('articlefeedback-field-trustworthy-label'), ('articlefeedback-field-objective-label'),
11 -('articlefeedback-field-complete-label'), ('articlefeedback-field-wellwritten-label');
12 -
132 -- Store article feedbacks (user rating per revision)
143 CREATE TABLE IF NOT EXISTS /*_*/article_feedback (
154 -- Foreign key to page.page_id
@@ -25,7 +12,7 @@
2613 aa_revision integer unsigned NOT NULL,
2714 -- MW Timestamp
2815 aa_timestamp binary(14) NOT NULL DEFAULT '',
29 - -- Foreign key to article_feedback_ratings.aar_rating
 16+ -- Rating ID, mapped to a name in $wgArticleFeedbackRatingTypes
3017 aa_rating_id int unsigned NOT NULL,
3118 -- Value of the rating (0 is "unrated", else 1-5)
3219 aa_rating_value int unsigned NOT NULL,
@@ -41,7 +28,7 @@
4229 CREATE TABLE IF NOT EXISTS /*_*/article_feedback_pages (
4330 -- Foreign key to page.page_id
4431 aap_page_id integer unsigned NOT NULL,
45 - -- Foreign key to article_feedback_ratings.aar_rating
 32+ -- Rating ID, mapped to a name in $wgArticleFeedbackRatingTypes
4633 aap_rating_id integer unsigned NOT NULL,
4734 -- Sum (total) of all the ratings for this article revision
4835 aap_total integer unsigned NOT NULL,
@@ -57,7 +44,7 @@
5845 afr_page_id integer unsigned NOT NULL,
5946 -- Revision that totals are relevant to
6047 afr_revision integer unsigned NOT NULL,
61 - -- Foreign key to article_feedback_ratings.aar_rating
 48+ -- Rating ID, mapped to a name in $wgArticleFeedbackRatingTypes
6249 afr_rating_id integer unsigned NOT NULL,
6350 -- Sum (total) of all the ratings for this article revision
6451 afr_total integer unsigned NOT NULL,
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -19,34 +19,6 @@
2020 'scripts' => 'ext.articleFeedback/ext.articleFeedback.js',
2121 'styles' => 'ext.articleFeedback/ext.articleFeedback.css',
2222 'messages' => array(
23 - 'articlefeedback-field-trustworthy-label',
24 - 'articlefeedback-field-trustworthy-tip',
25 - 'articlefeedback-field-trustworthy-tooltip-1',
26 - 'articlefeedback-field-trustworthy-tooltip-2',
27 - 'articlefeedback-field-trustworthy-tooltip-3',
28 - 'articlefeedback-field-trustworthy-tooltip-4',
29 - 'articlefeedback-field-trustworthy-tooltip-5',
30 - 'articlefeedback-field-complete-label',
31 - 'articlefeedback-field-complete-tip',
32 - 'articlefeedback-field-complete-tooltip-1',
33 - 'articlefeedback-field-complete-tooltip-2',
34 - 'articlefeedback-field-complete-tooltip-3',
35 - 'articlefeedback-field-complete-tooltip-4',
36 - 'articlefeedback-field-complete-tooltip-5',
37 - 'articlefeedback-field-objective-label',
38 - 'articlefeedback-field-objective-tip',
39 - 'articlefeedback-field-objective-tooltip-1',
40 - 'articlefeedback-field-objective-tooltip-2',
41 - 'articlefeedback-field-objective-tooltip-3',
42 - 'articlefeedback-field-objective-tooltip-4',
43 - 'articlefeedback-field-objective-tooltip-5',
44 - 'articlefeedback-field-wellwritten-label',
45 - 'articlefeedback-field-wellwritten-tip',
46 - 'articlefeedback-field-wellwritten-tooltip-1',
47 - 'articlefeedback-field-wellwritten-tooltip-2',
48 - 'articlefeedback-field-wellwritten-tooltip-3',
49 - 'articlefeedback-field-wellwritten-tooltip-4',
50 - 'articlefeedback-field-wellwritten-tooltip-5',
5123 'articlefeedback-pitch-reject',
5224 'articlefeedback-pitch-or',
5325 'articlefeedback-pitch-thanks',
@@ -71,8 +43,12 @@
7244 'jquery.articleFeedback',
7345 'jquery.cookie',
7446 'jquery.clickTracking',
 47+ 'ext.articleFeedback.ratingi18n',
7548 ),
7649 ),
 50+ 'ext.articleFeedback.ratingi18n' => array(
 51+ 'messages' => null, // Filled in by the resourceLoaderRegisterModules() hook function later
 52+ ),
7753 'ext.articleFeedback.dashboard' => array(
7854 'scripts' => 'ext.articleFeedback/ext.articleFeedback.dashboard.js',
7955 'styles' => 'ext.articleFeedback/ext.articleFeedback.dashboard.css',
@@ -269,7 +245,6 @@
270246 $tables[] = 'article_feedback';
271247 $tables[] = 'article_feedback_pages';
272248 $tables[] = 'article_feedback_revisions';
273 - $tables[] = 'article_feedback_ratings';
274249 $tables[] = 'article_feedback_properties';
275250 return true;
276251 }
@@ -289,6 +264,11 @@
290265 global $wgExtensionAssetsPath;
291266 $localpath = dirname( __FILE__ ) . '/modules';
292267 $remotepath = "$wgExtensionAssetsPath/ArticleFeedback/modules";
 268+
 269+ if ( self::$modules['ext.articleFeedback.ratingi18n']['messages'] === null ) {
 270+ self::$modules['ext.articleFeedback.ratingi18n']['messages'] = self::buildRatingMessagesArray();
 271+ }
 272+
293273 foreach ( self::$modules as $name => $resources ) {
294274 $resourceLoader->register(
295275 $name, new ResourceLoaderFileModule( $resources, $localpath, $remotepath )
@@ -307,7 +287,8 @@
308288 $wgArticleFeedbackLotteryOdds,
309289 $wgArticleFeedbackTracking,
310290 $wgArticleFeedbackOptions,
311 - $wgArticleFeedbackNamespaces;
 291+ $wgArticleFeedbackNamespaces,
 292+ $wgArticleFeedbackRatingTypes;
312293 $vars['wgArticleFeedbackSMaxage'] = $wgArticleFeedbackSMaxage;
313294 $vars['wgArticleFeedbackCategories'] = $wgArticleFeedbackCategories;
314295 $vars['wgArticleFeedbackBlacklistCategories'] = $wgArticleFeedbackBlacklistCategories;
@@ -315,6 +296,7 @@
316297 $vars['wgArticleFeedbackTracking'] = $wgArticleFeedbackTracking;
317298 $vars['wgArticleFeedbackOptions'] = $wgArticleFeedbackOptions;
318299 $vars['wgArticleFeedbackNamespaces'] = $wgArticleFeedbackNamespaces;
 300+ $vars['wgArticleFeedbackRatingTypesFlipped'] = array_flip( $wgArticleFeedbackRatingTypes );
319301 return true;
320302 }
321303
@@ -331,4 +313,15 @@
332314 );
333315 return true;
334316 }
 317+
 318+ protected static function buildRatingMessagesArray() {
 319+ global $wgArticleFeedbackRatingTypes;
 320+ $messages = array();
 321+ foreach ( $wgArticleFeedbackRatingTypes as $key ) {
 322+ foreach ( array( 'label', 'tip', 'tooltip-1', 'tooltip-2', 'tooltip-3', 'tooltip-4', 'tooltip-5' ) as $suffix ) {
 323+ $messages[] = "articlefeedback-field-$key-$suffix";
 324+ }
 325+ }
 326+ return $messages;
 327+ }
335328 }
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -204,7 +204,7 @@
205205 // Build data from form values for 'action=articlefeedback'
206206 var data = {};
207207 for ( var key in context.options.ratings ) {
208 - var id = context.options.ratings[key].id;
 208+ var id = context.options.ratings[key];
209209 data['r' + id] = context.$ui.find( 'input[name="r' + id + '"]' ).val();
210210 }
211211 var expertise = [];
@@ -410,8 +410,8 @@
411411 context.$ui.find( '.articleFeedback-rating' ).each( function() {
412412 var name = $(this).attr( 'rel' );
413413 var rating = name in context.options.ratings
414 - && context.options.ratings[name].id in ratings ?
415 - ratings[context.options.ratings[name].id] : null;
 414+ && context.options.ratings[name] in ratings ?
 415+ ratings[context.options.ratings[name]] : null;
416416 // Report
417417 if (
418418 rating !== null
@@ -489,12 +489,13 @@
490490 .find( '.articleFeedback-ratings' )
491491 .each( function() {
492492 for ( var key in context.options.ratings ) {
493 - var rating = context.options.ratings[key];
 493+ var tipMsg = 'articlefeedback-field-' + key + '-tip',
 494+ labelMsg = 'articlefeedback-field-' + key + '-label';
494495 $( $.articleFeedback.tpl.rating )
495496 .attr( 'rel', key )
496497 .find( '.articleFeedback-label' )
497 - .attr( 'title', mw.msg( rating.tip ) )
498 - .text( mw.msg( rating.label ) )
 498+ .attr( 'title', mw.msg( tipMsg ) )
 499+ .text( mw.msg( labelMsg ) )
499500 .end()
500501 .find( '.articleFeedback-rating-clear' )
501502 .attr( 'title', mw.msg( 'articlefeedback-form-panel-clear' ) )
@@ -709,8 +710,8 @@
710711 .end()
711712 // Name the hidden fields
712713 .find( '.articleFeedback-rating' )
713 - .each( function( rating ) {
714 - $(this).find( 'input:hidden' ) .attr( 'name', 'r' + ( rating + 1 ) );
 714+ .each( function() {
 715+ $(this).find( 'input:hidden' ) .attr( 'name', 'r' + context.options.ratings[$(this).attr( 'rel' )] );
715716 } )
716717 .end()
717718 // Setup switch behavior
@@ -838,9 +839,7 @@
839840 * }
840841 * } );
841842 *
842 - * Rating IDs need to match up to the contents of your article_feedback_ratings table, which is a
843 - * lookup table containing rating IDs and message keys used for translating rating IDs into string;
844 - * and be included in $wgArticleFeedbackRatings, which is an array of allowed IDs.
 843+ * Rating IDs need to be included in $wgArticleFeedbackRatingTypes, which is an array mapping allowed IDs to rating names.
845844 */
846845 $.fn.articleFeedback = function() {
847846 var args = arguments;
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js
@@ -199,28 +199,7 @@
200200 } )();
201201
202202 var config = {
203 - 'ratings': {
204 - 'trustworthy': {
205 - 'id': '1',
206 - 'label': 'articlefeedback-field-trustworthy-label',
207 - 'tip': 'articlefeedback-field-trustworthy-tip'
208 - },
209 - 'objective': {
210 - 'id': '2',
211 - 'label': 'articlefeedback-field-objective-label',
212 - 'tip': 'articlefeedback-field-objective-tip'
213 - },
214 - 'complete': {
215 - 'id': '3',
216 - 'label': 'articlefeedback-field-complete-label',
217 - 'tip': 'articlefeedback-field-complete-tip'
218 - },
219 - 'wellwritten': {
220 - 'id': '4',
221 - 'label': 'articlefeedback-field-wellwritten-label',
222 - 'tip': 'articlefeedback-field-wellwritten-tip'
223 - }
224 - },
 203+ 'ratings': mw.config.get( 'wgArticleFeedbackRatingTypesFlipped' ),
225204 'pitches': {
226205 'survey': {
227206 'weight': 1,
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/populateAFRevisions.php
@@ -28,7 +28,7 @@
2929 }
3030
3131 public function execute() {
32 - global $wgArticleFeedbackRatings;
 32+ global $wgArticleFeedbackRatingTypes;
3333
3434 $this->output( "Populating article_feedback_revisions table ...\n" );
3535
@@ -63,10 +63,10 @@
6464 );
6565
6666 // Initialize counts and sums for each rating
67 - // If $wgArticleFeedbackRatings = array( 1, 2, 3, 4 ) this initializes them
 67+ // If array_keys( $wgArticleFeedbackRatingTypes ) = array( 1, 2, 3, 4 ) this initializes them
6868 // to array( 1 => 0, 2 => 0, 3 => 0, 4 => 0 )
69 - $counts = $sums = array_combine( $wgArticleFeedbackRatings,
70 - array_fill( 0, count( $wgArticleFeedbackRatings ), 0 )
 69+ $counts = $sums = array_combine( array_keys( $wgArticleFeedbackRatingTypes ),
 70+ array_fill( 0, count( $wgArticleFeedbackRatingTypes ), 0 )
7171 );
7272
7373 // Process each of the queried rows and update $data
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/api/ApiArticleFeedback.php
@@ -5,7 +5,7 @@
66 }
77
88 public function execute() {
9 - global $wgUser, $wgArticleFeedbackRatings, $wgArticleFeedbackSMaxage,
 9+ global $wgUser, $wgArticleFeedbackRatingTypes, $wgArticleFeedbackSMaxage,
1010 $wgArticleFeedbackNamespaces;
1111 $params = $this->extractRequestParams();
1212
@@ -49,13 +49,13 @@
5050 'aa_user_id' => $wgUser->getId(),
5151 'aa_user_text' => $wgUser->getName(),
5252 'aa_page_id' => $params['pageid'],
53 - 'aa_rating_id' => $wgArticleFeedbackRatings,
 53+ 'aa_rating_id' => array_keys( $wgArticleFeedbackRatingTypes ),
5454 'aa_user_anon_token' => $token,
5555 ),
5656 __METHOD__,
5757 array(
5858 'ORDER BY' => 'aa_revision DESC',
59 - 'LIMIT' => count( $wgArticleFeedbackRatings ),
 59+ 'LIMIT' => count( $wgArticleFeedbackRatingTypes ),
6060 )
6161 );
6262
@@ -69,7 +69,7 @@
7070 $pageId = $params['pageid'];
7171 $revisionId = $params['revid'];
7272
73 - foreach( $wgArticleFeedbackRatings as $rating ) {
 73+ foreach( $wgArticleFeedbackRatingTypes as $rating => $unused ) {
7474 $lastRating = false;
7575 if ( isset( $lastRatings[$rating] ) ) {
7676 $lastRating = intval( $lastRatings[$rating]['value'] );
@@ -396,7 +396,7 @@
397397 ),
398398 );
399399
400 - foreach( $wgArticleFeedbackRatings as $rating ) {
 400+ foreach( $wgArticleFeedbackRatingsTypes as $rating => $unused ) {
401401 $ret["r{$rating}"] = array(
402402 ApiBase::PARAM_TYPE => 'integer',
403403 ApiBase::PARAM_REQUIRED => true,
@@ -410,7 +410,7 @@
411411 }
412412
413413 public function getParamDescription() {
414 - global $wgArticleFeedbackRatings;
 414+ global $wgArticleFeedbackRatingTypes;
415415 $ret = array(
416416 'pageid' => 'Page ID to submit feedback for',
417417 'revid' => 'Revision ID to submit feedback for',
@@ -418,7 +418,7 @@
419419 'bucket' => 'Which rating widget was shown to the user',
420420 'expertise' => 'What kinds of expertise does the user claim to have',
421421 );
422 - foreach( $wgArticleFeedbackRatings as $rating ) {
 422+ foreach( $wgArticleFeedbackRatingTypes as $rating => $unused ) {
423423 $ret["r{$rating}"] = "Rating {$rating}";
424424 }
425425 return $ret;
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedback/api/ApiArticleFeedback.php
___________________________________________________________________
Modified: svn:mergeinfo
426426 Merged /trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php:r100806
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php
@@ -5,31 +5,24 @@
66 }
77
88 public function execute() {
9 - global $wgArticleFeedbackRatings;
 9+ global $wgArticleFeedbackRatingTypes;
1010
1111 $params = $this->extractRequestParams();
1212 $result = $this->getResult();
1313 $revisionLimit = $this->getRevisionLimit( $params['pageid'] );
1414
15 - $this->addTables( array( 'article_feedback_revisions', 'article_feedback_ratings' ) );
 15+ $this->addTables( array( 'article_feedback_revisions' ) );
1616 $this->addFields( array(
1717 'MAX(afr_revision) as afr_revision',
1818 'SUM(afr_total) as afr_total',
1919 'SUM(afr_count) as afr_count',
2020 'afr_rating_id',
21 - 'aar_rating',
2221 ) );
23 - $this->addJoinConds( array(
24 - 'article_feedback_ratings' => array( 'LEFT JOIN', array(
25 - 'aar_id=afr_rating_id',
26 - 'afr_rating_id' => $wgArticleFeedbackRatings,
27 - )
28 - ),
29 - ) );
3022 $this->addWhereFld( 'afr_page_id', $params['pageid'] );
3123 $this->addWhere( 'afr_revision >= ' . $revisionLimit );
 24+ $this->addWhereFld( 'afr_rating_id', array_keys( $wgArticleFeedbackRatingTypes ) );
3225 $this->addOption( 'GROUP BY', 'afr_rating_id' );
33 - $this->addOption( 'LIMIT', count( $wgArticleFeedbackRatings ) );
 26+ $this->addOption( 'LIMIT', count( $wgArticleFeedbackRatingTypes ) );
3427
3528 // Rating counts and totals
3629 $res = $this->select( __METHOD__ );
@@ -44,7 +37,7 @@
4538 }
4639 $ratings[$params['pageid']]['ratings'][] = array(
4740 'ratingid' => (int) $row->afr_rating_id,
48 - 'ratingdesc' => $row->aar_rating,
 41+ 'ratingdesc' => $wgArticleFeedbackRatingTypes[$row->afr_rating_id],
4942 'total' => (int) $row->afr_total,
5043 'count' => (int) $row->afr_count,
5144 'countall' => isset( $historicCounts[$row->afr_rating_id] )
@@ -122,7 +115,7 @@
123116 }
124117
125118 protected function getHistoricCounts( $params ) {
126 - global $wgArticleFeedbackRatings;
 119+ global $wgArticleFeedbackRatingTypes;
127120
128121 $res = $this->getDB()->select(
129122 'article_feedback_pages',
@@ -132,7 +125,7 @@
133126 ),
134127 array(
135128 'aap_page_id' => $params['pageid'],
136 - 'aap_rating_id' => $wgArticleFeedbackRatings,
 129+ 'aap_rating_id' => array_keys( $wgArticleFeedbackRatingTypes ),
137130 ),
138131 __METHOD__
139132 );
@@ -174,30 +167,26 @@
175168 }
176169
177170 protected function getUserRatings( $params ) {
178 - global $wgUser, $wgArticleFeedbackRatings;
 171+ global $wgUser, $wgArticleFeedbackRatingTypes;
179172
180173 $res = $this->getDB()->select(
181 - array( 'article_feedback', 'article_feedback_ratings' ),
 174+ array( 'article_feedback' ),
182175 array(
183176 'aa_rating_id',
184 - 'aar_rating',
185177 'aa_revision',
186178 'aa_rating_value',
187179 ),
188180 array(
189181 'aa_page_id' => $params['pageid'],
190 - 'aa_rating_id' => $wgArticleFeedbackRatings,
 182+ 'aa_rating_id' => array_keys( $wgArticleFeedbackRatingTypes ),
191183 'aa_user_id' => $wgUser->getId(),
192184 'aa_user_text' => $wgUser->getName(),
193185 'aa_user_anon_token' => $this->getAnonToken( $params ),
194186 ),
195187 __METHOD__,
196188 array(
197 - 'LIMIT' => count( $wgArticleFeedbackRatings ),
 189+ 'LIMIT' => count( $wgArticleFeedbackRatingTypes ),
198190 'ORDER BY' => 'aa_revision DESC',
199 - ),
200 - array(
201 - 'article_feedback_ratings' => array( 'LEFT JOIN', array( 'aar_id=aa_rating_id' ) )
202191 )
203192 );
204193 $ratings = array();
@@ -211,7 +200,7 @@
212201 $ratings[$row->aa_rating_id] = array(
213202 'value' => $row->aa_rating_value,
214203 'revision' => $row->aa_revision,
215 - 'text' => $row->aar_rating,
 204+ 'text' => $wgArticleFeedbackRatingTypes[$row->aa_rating_id],
216205 );
217206 }
218207 }
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php
___________________________________________________________________
Modified: svn:mergeinfo
219208 Merged /trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php:r100806
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedback/ArticleFeedback.php
@@ -24,8 +24,8 @@
2525 // Number of revisions to keep a rating alive for
2626 $wgArticleFeedbackRatingLifetime = 30;
2727
28 -// Array of the "ratings" id's to store. Allows it to be a bit more dynamic
29 -$wgArticleFeedbackRatings = array( 1, 2, 3, 4 );
 28+// Array of rating types
 29+$wgArticleFeedbackRatingTypes = array( 1 => 'trustworthy', 2 => 'objective', 3 => 'complete', 4 => 'wellwritten' );
3030
3131 // Which categories the pages must belong to have the rating widget added (with _ in text)
3232 // Extension is "disabled" if this field is an empty array (as per default configuration)
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedback
___________________________________________________________________
Modified: svn:mergeinfo
3333 Merged /trunk/extensions/ArticleFeedback:r100806

Follow-up revisions

RevisionCommit summaryAuthorDate
r100811Fix typo in r100808catrope14:50, 26 October 2011
r100814And another typo in r100808catrope14:51, 26 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100806Make ArticleFeedback actually support custom rating types properly. This is g...catrope14:19, 26 October 2011

Comments

#Comment by G.Hagedorn (talk | contribs)   21:01, 26 October 2011

applied to 1.18wmf1, please consider tagging for 1.18

#Comment by Reedy (talk | contribs)   21:02, 26 October 2011

Why do you keep saying this on nearly every merge?

Most are feature ports from trunk to deployment for WMF usage. Backport to REL1_18 isn't necessary in most cases wehen it's not bug fixes

#Comment by G.Hagedorn (talk | contribs)   21:23, 26 October 2011

I cannot always see what is a feature and what a bug. Like here (but since this is the merge, saying it was probably a mistake here). But http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100806 suggests that this is fixing bugs. I come from the experience that with 1.17 we were unable to find a working combination: the 1.17 extensions was buggy or insufficient, the trunk extension already in 1.19alpha, requiring features not yet in 1.17, and the 1.17wmf1-version was wmf-specific. At the same time, everything was working fine on Wikipedia.

What makes WMF feature requirements here different from other user's requirements?

I only say it on extensions which we eagerly look forward to use, like MobileFrontend, or this.

#Comment by Reedy (talk | contribs)   22:12, 26 October 2011

SVN Switch to trunk MF if you want trunk features

We don't usually want to backport new features to older branches


In theory, people will look forward to using every extension...

#Comment by G.Hagedorn (talk | contribs)   22:31, 26 October 2011

> In theory, people will look forward to using every extension...

I am more than happy if trunk extensions work with the last stable core. But it does not work if core and extensions are incompatible due to changes in core. And yes, we already try to mix and match 1.18beta with 1.18, tagged, and 1.19 trunk extensions.

Status & tagging log