r108239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108238‎ | r108239 | r108240 >
Date:15:30, 6 January 2012
Author:rsterbin
Status:ok
Tags:
Comment:
Bug fix: Empty ratings should not be sent as rating=0, but rather not included in the post at all
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -1026,7 +1026,10 @@
10271027 */
10281028 getFormData: function () {
10291029 var data = {};
1030 - data.rating = $.articleFeedbackv5.find( '.articleFeedbackv5-rating input:hidden' ).val();
 1030+ var rating = $.articleFeedbackv5.find( '.articleFeedbackv5-rating input:hidden' ).val();
 1031+ if ( '0' != rating ) {
 1032+ data.rating = rating;
 1033+ }
10311034 data.comment = $.articleFeedbackv5.find( '.articleFeedbackv5-comment textarea' ).val();
10321035 if ( data.comment == mw.msg( 'articlefeedbackv5-bucket3-comment-default' ) ) {
10331036 data.comment = '';
@@ -1719,7 +1722,10 @@
17201723 var info = $.articleFeedbackv5.currentBucket().ratingInfo;
17211724 for ( var i = 0; i < info.length; i++ ) {
17221725 var key = info[i];
1723 - data[key] = $.articleFeedbackv5.find( 'input[name="' + key + '"]' ).val();
 1726+ var val = $.articleFeedbackv5.find( 'input[name="' + key + '"]' ).val();
 1727+ if ( '0' != val ) {
 1728+ data[key] = val;
 1729+ }
17241730 }
17251731 $.articleFeedbackv5.find( '.articleFeedbackv5-expertise input:checked' ).each( function () {
17261732 data['expertise-' + $( this ).val()] = 1;

Follow-up revisions

RevisionCommit summaryAuthorDate
r1084701.18wmf1: MFT r108239, r108245, r108247, r108250, r108269, r108280catrope20:28, 9 January 2012

Status & tagging log