Page 1 of 1

PHP notice in api.php

Posted: 13 Feb 2018 01:28
by AlexMyltsev
Hi,

I've tried to use MediaWiki API to edit pages, and this was the response I got for the edit request:

Code: Select all

{"edit":{"result":"Success","pageid":189178,"title":"User:AlexMyltsev/previews split","contentmodel":"wikitext","oldrevid":880001,"newrevid":880002,"newtimestamp":"2018-02-13T01:21:29Z"}}
Notice: Undefined offset: 2 in /home/choralwi/public_html/wiki/extensions/ChoralWiki/EditionDataGrabber.php on line 113
The PHP notice, of course, makes the response non-valid JSON. Can we fix the API?

Re: PHP notice in api.php

Posted: 13 Feb 2018 16:37
by choralia
Please try again. It should be fixed now.

Max

Re: PHP notice in api.php

Posted: 14 Feb 2018 15:03
by AlexMyltsev
Got another one:

Code: Select all

Warning: Missing argument 12 for EditionDataGrabber() in /home/choralwi/public_html/wiki/extensions/ChoralWiki/EditionDataGrabber.php on line 9

Re: PHP notice in api.php

Posted: 14 Feb 2018 15:28
by choralia
This seems more tricky. As a workaround I disabled warnings on this script. Could you please try again?

Max

Re: PHP notice in api.php

Posted: 26 Feb 2018 12:49
by AlexMyltsev
Thank you Max, the API seems to work perfectly now.