Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress Moderation -> deactivate topic subscriptions


  • BBIndikator
    Participant

    @bbindikator

    Hello there, hope you’re well..

    Has anybody a working solution for the following issue?

    Newest WP and bbPress, last version of bbPress Moderation.

    If bbPress Moderation is active, it will deactivate users subscription to a topic, after status from a pending reply of this user is changed to publish. It deactivate both possibilities: subscription on top and it uncheck the email notification status inside the bbp-form.

    I tried to deactivate all other plugins, but it will not work, too.

    Is anybody out there with a tip or a working solution ?

    Thank you and best regards

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

  • BBIndikator
    Participant

    @bbindikator

    bbPress Moderation uses this function:
    bbp_notify_topic_subscribers( $reply_id, $topic_id, $forum_id );

    On this transition-hook:
    add_action( ‘pending_to_publish’, array( $this, ‘pending_to_publish’ ), 10, 1 );

    But it seems that it will not work properly..


    Robkk
    Moderator

    @robkk

    So topic subscriptions do not work if you subscribe to the topic after it has been approved??

    Did topic subscriptions work before you installed bbpress moderation??


    BBIndikator
    Participant

    @bbindikator

    Yes, it works pretty well without the moderation extension. It works also pretty well, after a user sent a message, as long as it is waiting for moderation.

    But if we publish the pending message, the subscription of this user is deactivated.


    Robkk
    Moderator

    @robkk

    After it is approved and when the user subscribes to it again by clicking the subscribe link , do the topic subscriptions work well then??


    BBIndikator
    Participant

    @bbindikator

    Yes, after pending post is published, a user can subscribe again and it will work as long as this user is sending a new reply to moderate.


    BBIndikator
    Participant

    @bbindikator

    It’s really strange. After the post is submitted (and as long as status is pending), the topic is included in the users subscriptions: (var_dump on wp_footer)

    bbp_get_user_subscribed_topic_ids( $reply_author_id );

    bbPress Moderation uses the hook “pending_to_publish” to send an Info to all subscribed users that this new reply is published:

    function pending_to_publish( $post )
    {
       ...
       bbp_notify_topic_subscribers( $reply_id, $topic_id, $forum_id );
    }

    If I add this:

    bbp_get_user_subscribed_topic_ids( $reply_author_id );

    into this function before or below “bbp_notify_topic_subscribers” and write a var_dump to a separate file, the topic-id is still inside the topic-id-array during the publish process ( {old}_to_{new} ).

    But if I var_dump this array directly afterwards (frontpage: page reload –> wp_footer ), the id isn’t still in there (email fails if I post with another user).

    It seems that anything erase this specific topic-id for this specific reply-author between publish and the next page load. All other topic-ids are still in this array..?

    To add it manually to the hook ‘publish_reply’ with this bbp-function doesn’t work:

    bbp_add_user_topic_subscription( $reply_author_id, $topic_id );

    Has anybody an idea why this can happen?

    As long as the reply isn’t publish, everything works right with the subscription. It’s also possible to manually add this user to this specific topic after the reply is published. But if this user send a new post for this topic, the topic-id is erased inside the subscription array after publishing..

    No caching is active…

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar