WordPress.org

Ready to get started?Download WordPress

Forums

SN Rating
[resolved] unexpected T_OBJECT_OPERATOR (7 posts)

  1. edik
    Member
    Posted 1 year ago #

    Hi,
    after the update to 1.4.4 I get the following error:
    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/content/04/10882704/html/wp-content/plugins/sn-rating/sn_rating.php on line 131
    How could you overlook this bug? :D It should invariably produce a syntax error imho.

    http://wordpress.org/extend/plugins/sn-rating/

  2. pgautam
    Member
    Plugin Author

    Posted 1 year ago #

    Hi plocha,

    Sorry for inconvenience faced by you because of this issue, but can you please let us know which version of PHP you are using as initially it seems to be an version issue.

    As soon as you reply to us we will deploy a new version of rating plugin with resolution of this particular issue.

    Best Regards,
    Paritosh Gautam

  3. edik
    Member
    Posted 1 year ago #

    I am using the following version: 5.3.10-1ubuntu3.6
    Thanks for the quick reply

  4. ered15
    Member
    Posted 1 year ago #

    Unfortunately, it is not possible to call a method on an object just created with new before PHP 5.4. This is PHP in a version from 5.4 ongoing:

    EDIT: sn_rating.php

    Replace:
    $post = get_Post((new BP_Activity_Activity(bp_Get_Activity_Id()))->item_id);

    WITH:

    $BP_Activity = new BP_Activity_Activity(bp_Get_Activity_Id());
    $post = $BP_Activity->item_id();

    Replace:
    echo (new Rating())->generateRatingBox($post);

    WITH:

    $BP_Rating = new Rating();
    echo $BP_Rating->generateRatingBox($post);

    HOPE IT HELPS!

  5. pgautam
    Member
    Plugin Author

    Posted 1 year ago #

    Hi plocha,

    Can you please drop a mail to paritoshgautam@hotmail.com i will provide you an updated file, please let me know if that works for you.

    Thanks & Regards,
    Paritosh Gautam

  6. pgautam
    Member
    Plugin Author

    Posted 1 year ago #

    Hi ered15,

    Thanks for your reply, we have also figured out the same solution at our end and changed our code for older version of PHP.

    Best Regards,
    Paritosh Gautam

  7. edik
    Member
    Posted 1 year ago #

    Okay, it works now. Thank you very much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic