• Resolved jasonthoele

    (@jasonthoele)


    We’ve located an error in the system, when you post something on the activity stream and someone likes the post everything works fine. The issue is if someone comments on the original post and that new comment is liked. It will post an error. Please advise on how to resolve.

    Here is a example of the error thats under the comment of the post;

    Warning: array_keys() expects parameter 1 to be array, string given in /wp-content/plugins/buddypress-like/includes/like-functions.php on line 479

    https://www.ads-software.com/plugins/buddypress-like/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jasonthoele

    (@jasonthoele)

    FIXED

    I had an issue with getting this message…

    Warning: array_keys() [function.array-keys]: The first argument should be an array…

    so I edited line 479 of the file… /includes/like-functions.php

    from this…

    $users_who_like = array_keys( bp_activity_get_meta( $bp_like_id , ‘liked_count’ , true ) );

    to this

    $users_who_like = array_keys( (array)(bp_activity_get_meta( $bp_like_id , ‘liked_count’ , true )) );

    and this fixed the problem – fyi

    Plugin Author darrenmeehan

    (@darrenmeehan)

    Thanks for that Jason!

    I didn’t want to cast to an array, but I also wasn’t aware sites would be displaying these warnings. I’ll update with the fix thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Liked comments of original post getting error’ is closed to new replies.