Skip to content

Commit 5c352f4

Browse files
committed
Making query compatible with MW 1.26+
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.
1 parent ddd3ea3 commit 5c352f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎mw/api/collections/revisions.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ def _query(self, revids=None, titles=None, pageids=None, properties=None,
153153

154154
params = {
155155
'action': "query",
156-
'prop': "revisions"
156+
'prop': "revisions",
157+
'rawcontinue': ''
157158
}
158159

159160
params['revids'] = self._items(revids, type=int)
@@ -179,7 +180,7 @@ def _query(self, revids=None, titles=None, pageids=None, properties=None,
179180
params['rvparse'] = none_or(parse, bool)
180181
params['rvsection'] = none_or(section, int)
181182
params['rvtoken'] = none_or(token, str)
182-
params['rvcontinue'] = none_or(rvcontinue, int)
183+
params['rvcontinue'] = none_or(rvcontinue, str)
183184
params['rvdiffto'] = self._check_diffto(diffto)
184185
params['rvdifftotext'] = none_or(difftotext, str)
185186
params['rvcontentformat'] = none_or(contentformat, str)

0 commit comments

Comments
 (0)