Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59816
Change subject: Makes sure caches are bust when fetching feedback/activity
......................................................................
Makes sure caches are bust when fetching feedback/activity
IE9 doesn't seem to fire the requests anew; adding an explicit cache: false
(which will append a unique timestamp to the request) will make sure IE9 really
does request fresh data (instead of serving the same old data that likely has
changed already when heavily moderating feedback.
Bug: 46797
Change-Id: I0bffc61e6203c91682d70e5c1dae5134af044ca5
---
M api/ApiViewActivityArticleFeedbackv5.php
M api/ApiViewFeedbackArticleFeedbackv5.php
M modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
3 files changed, 24 insertions(+), 6 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5
refs/changes/16/59816/1
diff --git a/api/ApiViewActivityArticleFeedbackv5.php
b/api/ApiViewActivityArticleFeedbackv5.php
index 1a06547..5758384 100644
--- a/api/ApiViewActivityArticleFeedbackv5.php
+++ b/api/ApiViewActivityArticleFeedbackv5.php
@@ -29,6 +29,14 @@
public function execute() {
wfProfileIn( __METHOD__ );
+ /*
+ * To bust caches, this GET value may be added to the
querystring. Codewise,
+ * we won't really use it for anything, but we don't want it to
output a
+ * "Unrecognized parameter" warning either, so let's make sure
ApiMain
+ * considers it used ;)
+ */
+ $this->getMain()->getVal( '_' );
+
global $wgUser, $wgLang;
if ( !$wgUser->isAllowed( 'aft-editor' ) ) {
diff --git a/api/ApiViewFeedbackArticleFeedbackv5.php
b/api/ApiViewFeedbackArticleFeedbackv5.php
index 7d51644..5b15006 100644
--- a/api/ApiViewFeedbackArticleFeedbackv5.php
+++ b/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -27,6 +27,14 @@
public function execute() {
wfProfileIn( __METHOD__ );
+ /*
+ * To bust caches, this GET value may be added to the
querystring. Codewise,
+ * we won't really use it for anything, but we don't want it to
output a
+ * "Unrecognized parameter" warning either, so let's make sure
ApiMain
+ * considers it used ;)
+ */
+ $this->getMain()->getVal( '_' );
+
$params = $this->extractRequestParams();
$result = $this->getResult();
$html = '';
diff --git
a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
index 55fef3b..1414fb3 100644
--- a/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
+++ b/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -857,6 +857,7 @@
'type': 'GET',
'dataType': 'json',
'data': data,
+ 'cache' : false,
'context': { location: location },
'success': function( data ) {
if (
data['articlefeedbackv5-view-activity'].hasHeader ) {
@@ -928,12 +929,13 @@
'maxage': 0
};
$.ajax( {
- 'url' : $.articleFeedbackv5special.apiUrl,
- 'type' : 'GET',
- 'dataType': 'json',
- 'data' : params,
- 'context': { info: params },
- 'success': function ( data ) {
+ 'url' : $.articleFeedbackv5special.apiUrl,
+ 'type' : 'GET',
+ 'dataType' : 'json',
+ 'data' : params,
+ 'cache' : false,
+ 'context' : { info: params },
+ 'success' : function ( data ) {
if ( 'articlefeedbackv5-view-feedback' in data
) {
if ( resetContents ) {
$(
'#articleFeedbackv5-show-feedback' ).empty();
--
To view, visit https://gerrit.wikimedia.org/r/59816
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bffc61e6203c91682d70e5c1dae5134af044ca5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits