PHP notice in api.php

Forum for all users to discuss the implementation and operation of the ChoralWiki at CPDL
Post Reply
AlexMyltsev
Posts: 15
Joined: 04 Jul 2013 09:33

PHP notice in api.php

Post 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?
choralia
Site Admin
Posts: 2924
Joined: 05 Mar 2006 19:57
Location: Rome, Italy
Contact:

Re: PHP notice in api.php

Post by choralia »

Please try again. It should be fixed now.

Max
AlexMyltsev
Posts: 15
Joined: 04 Jul 2013 09:33

Re: PHP notice in api.php

Post 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
choralia
Site Admin
Posts: 2924
Joined: 05 Mar 2006 19:57
Location: Rome, Italy
Contact:

Re: PHP notice in api.php

Post by choralia »

This seems more tricky. As a workaround I disabled warnings on this script. Could you please try again?

Max
AlexMyltsev
Posts: 15
Joined: 04 Jul 2013 09:33

Re: PHP notice in api.php

Post by AlexMyltsev »

Thank you Max, the API seems to work perfectly now.
Post Reply