Skip to:
Content
Pages
Categories
Search
Top
Bottom

BuddyPress and Site wide tags plugin


  • Phlux0r
    Participant

    @phlux0r

    I’ve put this into the Trac already.

    Watch out when using Donncha’s site wide tags plugin with BuddyPress. You may get hundreds of duplicate posts in the tags blog as the plugin enters into an infinite loop until the PHP script timeout is reached when someone posts a new blog post.

    I traced it to the activity recording mechanism when a user writes a blog post. Buddypress hooks into the “publish_post” action which, for some reason I have not established, interferes with the site wide tags plugin.

    So if you are using both on your site and experience this behavior, you know why.

    I simply commented out the publish_post hook in bp_blogs.php until there is a fix.

Viewing 22 replies - 1 through 22 (of 22 total)

  • Andy Peatling
    Keymaster

    @apeatling

    Talked with Donncha about this. A check needs to be added to check if the blog_id = tag_blog_id and if so, return from the function. This will stop the infinite loop.


    gogoplata
    Participant

    @gogoplata

    Thanks for posting about this. I was going to try that plugin soon, but will wait for a fix before I give it a go.


    Phlux0r
    Participant

    @phlux0r

    Thanks Andy.

    I knew I wasn’t going crazy ;)


    kunefr
    Member

    @kunefr

    Any news about the fix ? It could help us a lot !


    Burt Adsit
    Participant

    @burtadsit

    I can’t get the site wide tagging plugin to work properly at all with bp.

    I remember testing it before I fired up bp and it seemed to work great. Now I don’t get the posts being replicated properly. Doesn’t create categories and it doesn’t use a permalink to the originating blog. I get permalinks to the ‘tag’ blog. Like they were created on the tag blog. Not much use that. It just acts flaky with bp installed.

    I sure wish I could use it! That kind of functionality is pretty important in a blog community.


    Burt Adsit
    Participant

    @burtadsit

    I fired up another ticket on this. The fix for the infinite loop doesn’t seem to work. Running with that fix and it still happens. Other strange things happen as well. I disabled the blogs component in the mean time.


    kunefr
    Member

    @kunefr

    I hope that a fix will be find … I agree that this kind of functionality is really important.

    I know exactly how i want to use it but we have to be patient …

    I will follow this thread !! :)

    Hi to all, i will tell you my little experience with the subject.

    First of all: How does the global tags blog work? Simple, when someone makes a post, WPMU triggers an event. Basically there is a plugin that is hooked to that event, and when the post is made, it copies the post to a TAG blog (typically “invisible” and with a modified template, i will try not to extend here). But it dupplicates the post in the tag blog, and when you wanna show a cool plugin with al the site tags, you add the standard WP tag function instantiating that blog.

    THE PROBLEM WITH BUDDYPRESS:

    Inspite that in the PHP code of buddypress tries to evaluate, reading the options of WPMU if the POST comes from the TAG BLOG, it fails, cause there is an environment problem there. $BP and $WP* does not bring the correct actual blog id from the Blog where the post was made (Tag blog) so it thinks it´s a new entry, so boom, it keeps on publishing, POST – HOOK – POST – HOOK etc… until the buffer makes a little BOOM!. And it stops.

    What i did (i figured this problem the first time i installed buddypress) and maybe it´s not the best answer to your problem, is to use my own post indexer (i was using that plugin before for other reasons) so i took the HOOK of SAVED or PUBLISH i don´t remember and i am triggering the BP post record function directly from my plugin.

    But the important thing is that, the BP code is perfect at that point, it tries to evaluate if the blog is the TAGS BLOG, but there´s a problem with the environment $BP or $WP**** at that point, so the BLOG_ID is messed.

    Hope it helps Andy.

    Z.

    Hi thezohan10,

    Thanks for your reply.

    You solution is interresting. Did you modify the plugin or did you create your own ?

    In any case, can you share your code ?

    Thanks!


    Burt Adsit
    Participant

    @burtadsit

    I really have nothing to add. Just watching this thread ’cause I surely would like bp and the tags plugin to play nice with each other. This is just a long winded bump.

    any news on this ?


    alunsina
    Participant

    @alunsina

    i’d really really want an update on this one. is there something i can do about this apart from disabling one of the best feature in BP?


    Burt Adsit
    Participant

    @burtadsit

    If you take a look at Trac you’ll see that this issue is represented as tickets:

    https://trac.buddypress.org/ticket/336

    https://trac.buddypress.org/ticket/175

    You’ll also notice lots of bp related tickets that stem from the alpha and recent beta release. If I were lead developer on an open source community project such as this, I’d pay attention first to the tickets that related to getting bp to beta 2.

    I’ve decided that this issue is *our* problem. *We* need to fix it. I’ve got some time to give to it and that’s what I’m gonna do today. Anybody else willing to help work on this community problem?

    Coincidentally, I just submitted a possible fix. Worth a shot. The sitewide tags plugin is working on my local install.

    Sounds very good… but I am not sure, what that means:

    Do we still need the patch submitted in ticket175 or is that already implemented in BPbeta2?

    Thanks for all your work,

    Michael


    Burt Adsit
    Participant

    @burtadsit

    Sitewide tags is up and running with bp. No problems encountered so far.


    elbaina
    Participant

    @elbaina

    i have a problem with site wide tags and BP. The problem is i have duplicate post on the recent post widget, one for the original post and other for the tags blog post.

    Is there any solution to solve that?

    Well this is frustrating. I implemented Donncha’s SWT plugin, which is working fine, apart from the duplicate blog posts in the activity stream. I have SWT using the main site as the tags site, so clearly the activity stream is showing both the original post (on a user site) and the ghost of that post being tagged in the main site.

    I looked at Burt’s patch on trac, (which is 2 years old now) but when I tried the patch in bp-blog.php I found it was already applied in BP1.2.8 (albeit in a slightly different form).

    At the moment all I want to do is stop the duplicates being displayed in the activity stream (i.e. hide the tag blog occurance). I’ve tried checking if ‘blog_id’ is equal to ‘tag_blog_id’ and then applying this fix to /activity/entry.php, but perhaps my syntax is wrong.

    Has anyone got a working hack they’d like to share?

    @apeatling I believe you said it was working on your local install..?


    Nahum
    Participant

    @nahummadrid

    @doctordr You could make your SWT blog private or try this plugin https://buddypress.org/community/groups/buddypress-block-activity-stream-types/ I remember there is a way to block specific blog IDs from appearing in the activity stream but the plugin developer is no longer keeping up with this plugin and it appears his site is offline. there may be instances of the fix around here on the forums though.

    Thanks @nahummadrid, my SWT blog is ‘already’ private and since my SWT blog is also my main site that little trick makes no difference to what appears on the activity stream (which of course is also on the main site).

    I can only assume most BP sites are not also running SWT otherwise there would be more debate (and potential solutions) availabe to help.


    Nahum
    Participant

    @nahummadrid

    @doctordr activate that plugin I mentioned and add this to your bp-custom.php

    `
    //if php is older then change $a to &$a
    function my_block_activity_type_blog_id_before_save( $type, $a ) {
    global $bp;

    //if there is an id – we don’t care… updating
    if ( $a->id )
    return $type;

    //Come and see the violence inherent in the system. Help! Help! I’m being repressed!
    //key on the blog types (even for comments posted to that blog)
    if ( $a->type == ‘new_blog_post’ || $a->type == ‘new_blog_comment’ ) {

    //item_id is the blog_id in this context
    //could add more blog_ids here as well or even parlay into switch_to_blog to block categories, etc
    if ( $a->item_id == 1) {
    $a->type = null;
    return null;
    }
    }

    //otherwise continue if nothing happened
    return $type;
    }
    add_filter(‘bp_activity_type_before_save’, ‘my_block_activity_type_blog_id_before_save’, 9999, 2);
    `
    I think that works. If item_id == 1 is the blog_id you want to exclude.

Viewing 22 replies - 1 through 22 (of 22 total)
  • The topic ‘BuddyPress and Site wide tags plugin’ is closed to new replies.
Skip to toolbar