Skip to content

Commit

Permalink
Making query compatible with MW 1.26+
Browse files Browse the repository at this point in the history
According to https://www.mediawiki.org/wiki/API:Query#Backwards_compatibility_of_continue, in new versions of Mediawiki (including the version running currently on WP), the 'query-continue' parameter has been deprecated in favor of a simpler 'continue'. However, the old 'query-continue' can still be retrieved if the query parameter includes a 'rawcontinue' flag, which I added.
  • Loading branch information
jdfoote committed Jul 17, 2015
1 parent ddd3ea3 commit 5c352f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mw/api/collections/revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def _query(self, revids=None, titles=None, pageids=None, properties=None,

params = {
'action': "query",
'prop': "revisions"
'prop': "revisions",
'rawcontinue': ''
}

params['revids'] = self._items(revids, type=int)
Expand All @@ -179,7 +180,7 @@ def _query(self, revids=None, titles=None, pageids=None, properties=None,
params['rvparse'] = none_or(parse, bool)
params['rvsection'] = none_or(section, int)
params['rvtoken'] = none_or(token, str)
params['rvcontinue'] = none_or(rvcontinue, int)
params['rvcontinue'] = none_or(rvcontinue, str)
params['rvdiffto'] = self._check_diffto(diffto)
params['rvdifftotext'] = none_or(difftotext, str)
params['rvcontentformat'] = none_or(contentformat, str)
Expand Down

0 comments on commit 5c352f4

Please sign in to comment.