The solution to make this working is to modify User.php as follow :
if (!$json_api->query->comment_status ) {
$json_api->error("Please include 'comment_status' var in your request. Possible values are '1' (approved) or '0' (not-approved)");
}else $comment_approved = $json_api->query->comment_status;
modified :
if (!isset($json_api->query->comment_status) ) {
$json_api->error("Please include 'comment_status' var in your request. Possible values are '1' (approved) or '0' (not-approved)");
}else $comment_approved = $json_api->query->comment_status;
Thank you for pointing out the bug.
Plugin has been updated and current version 2.7 has updated post_comment endpoint.
I checked the V2.7 regarding this issue, and it still not work.
It seems isset() still returns false if the variable is zero.
After some research, It seems difficult to test a variable if it is zero.
I suggest the url should be comment_status=’0′ or comment_status=’1′ so the tests are easier, then, we updating database, cast to integer as follow :
$data = array(
…
…
‘comment_approved’ => (int) $comment_approved,
);
I did not check this but I guess it should work.
Thanks
Jerome
I will check this issue and test it thoroughly before making an update in couple of days.
Hi Ali,
Any news regarding this pending issue ?
Thanks
Jerome
I have updated the plugin. version 2.8 has resolved this issue.
You can send comment_status=hold for unapproved comment and comment_status=1 for approved.
plz review the plugin and help others by rating.