Support » Plugin: BuddyPress Links » Bug report / fix: Comments getting shown on wrong links

  • Resolved jepsonrae


    The generate_cloud_id function in bp-links-classes.php generates an id which is incompatible with how buddypress stores item_ids (BIGINT) in the wp_bp_activity table. This results in that column often getting filled with 0 which means that comments are getting shared between all links with an item_id of 0.

    I’ve temporarily fixed this on my install by changing the md5 hash generation to a simple concatenation of rand(0,9999) + time() + rand(0,9999) to generate an integer no larger than 20 characters. This seems to have fixed the problem for me.

    Code as follows (line 298 of bp-links-classes.php):

    private function generate_cloud_id() {
    	global $bp;
    	if ( $this->url ) {
    		return rand(1,999) . time() . rand(1,999);
    	} else {
    		return false;

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author MrMaz


    Thank you for this report! I have been receiving some really bizarre complaints, and I think this explains them all. At some point they must have changed the schema for that table and I missed it.

    The cloud id thing never really turned into a feature, so I might just drop it completely by setting it to the same as ‘id’.

    Let me know if you are interested in helping with development of the free plugin.

    Plugin Author MrMaz


    I just made a commit to core which keeps the cloud id, but stops using it in the activity table. I also added an upgrade routine which fires on activation that repairs existing activity stream items by comparing the link slug to the end of the primary_link in the activity table.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug report / fix: Comments getting shown on wrong links’ is closed to new replies.