issue of response of PodioItemDiff::revert . It did not work well anymore .
previously, I can use PodioItemDiff::revert to revert an item to a certain revision, but now when I invoke this api, I get error:"Cannot use object of type PodioResponse as array", By debugging I found that the revert api invoke Podio::delete api, and assign the response to a $body variable, and then return $body['revison'], in previous, it's ok. But now the podio server response 204(the item is not reverted.), and the $body is assign to false, that is to say, there is no ['revision'] element in the response anymore. How can I revert a item to a specific revision now?
-
By my analyse, the podio.com's "revert this revision" function is implemented by calling a delete method, and its url is:"https://podio.com/_json/items/162690513/revisions/8", but I checked the PodioItemDiff::revert api in PodioItemDiff.php, its url is:"/item/{$item_id}/revision/{$revision_id}", so I think the url could be wrong, so I changed it to "/_json/items/{$item_id}/revisions/{$revision_id}", but I got error:
[2014-06-04 13:24:25] production.ERROR: PodioNotFoundError: "No matching operation could be found. The path '/_json/items/162690513/revisions/2' was not found.."
Request URL: http://api.podio.com/_json/items/162690513/revisions/2Stack Trace:
#0 E:\tools\Player\StudyMan\Web\Eclipse\workspace\zy\Depend\lib\Podio.php(321): Podio::request('DELETE', '/_json/items/16...', Array)
#1 E:\tools\Player\StudyMan\Web\Eclipse\workspace\zy\Depend\models\PodioItemDiff.php(22): Podio::delete('/_json/items/16...')What should I do to make a revision revert?
-
URLs that are not on api.podio.com are for internal use and you won't be able to use them. I just closed a pull request that I believe will fix your issue. Details at: https://github.com/podio/podio-php/pull/52
-
Thanks for your support . We tested the API ,but we can revert sucessfully occasionally, and fail sometimes, I don't know why. All Items I revert by workspace admin role are also created by workspace admin, and When success, I get a response of 200, when I fail, I get a response of 204 .
I would like to know when the revert api will successfully revert item ? or what the precondition to revert a revision is ?
Please sign in to leave a comment.
Comments
4 comments