Skip to:
Content

bbPress.org

Opened 8 weeks ago

Last modified 8 weeks ago

#3362 new defect

Admin area updates delete subscriptions on posts.

Reported by: wpturk Owned by:
Milestone: Awaiting Review Priority: highest
Severity: major Version:
Component: General Keywords:
Cc:

Description

I am running the latest 2.6.4 and discovered problem regarding subscriptions:

This is before updating topic (post_id:60483) in admin area:

mysql> select * from forum_postmeta where meta_key="_bbp_subscription" and post_id="60483" ;
+---------+---------+-------------------+------------+
| meta_id | post_id | meta_key          | meta_value |
+---------+---------+-------------------+------------+
|   61987 |   60483 | _bbp_subscription | 4811       |
+---------+---------+-------------------+------------+
1 row in set (0.00 sec)

This is after updating the topic (post_id:60483) in admin area:

mysql> select * from forum_postmeta where meta_key="_bbp_subscription" and post_id="60483" ;
Empty set (0.00 sec)

The subscription is DELETED after admin changes something and updates a post.

Change History (2)

#1 @wpturk
8 weeks ago

Ok it took me a few hours but I found what is deleting the subscription:

Line 811 in bbpress/includes/topics/functions.php (if I comment this line it works fine)

                // Check if subscribed
                $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );

                // Check for action
                $subscheck  = ( ! empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' === $_POST['bbp_topic_subscription'] ) )
                        ? true
                        : false;

                // Subscribed and unsubscribing
                if ( ( true === $subscribed ) && ( false === $subscheck ) ) {
                        bbp_remove_user_subscription( $author_id, $topic_id );

During backend update there will be no checkbox selected and $subscheck is false and bbp_remove_user_subscription is executed. This explains also why only author subscription is deleted not other subscribers.

#2 @wpturk
8 weeks ago

the same issue for replies: bbpress/includes/replies/functions.php

Note: See TracTickets for help on using tickets.