Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter jeromedms

    (@jeromedms)

    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;
    Plugin Author Ali Qureshi

    (@parorrey)

    Thank you for pointing out the bug.

    Plugin has been updated and current version 2.7 has updated post_comment endpoint.

    Thread Starter jeromedms

    (@jeromedms)

    great, thanks

    Thread Starter jeromedms

    (@jeromedms)

    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

    Plugin Author Ali Qureshi

    (@parorrey)

    I will check this issue and test it thoroughly before making an update in couple of days.

    Thread Starter jeromedms

    (@jeromedms)

    Thanks Ali.

    Thread Starter jeromedms

    (@jeromedms)

    Hi Ali,
    Any news regarding this pending issue ?
    Thanks
    Jerome

    Plugin Author Ali Qureshi

    (@parorrey)

    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.

    Thread Starter jeromedms

    (@jeromedms)

    great, it works now

    Plugin Author Ali Qureshi

    (@parorrey)

    plz review the plugin and help others by rating.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Error while adding comment’ is closed to new replies.