Skip to:

Opened 10 years ago

Last modified 9 years ago

#2581 new defect (bug)

Topic and forum favorite and subscription filters

Reported by: robin-w's profile Robin W Owned by: netweb's profile netweb
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: General Keywords: needs-patch


bbpress/includes/topics/template.php has errors

  1. wrong parse call

function bbp_get_topic_subscription_link
......Parse the arguments......
'get_forum_subscribe_link' );

so the function is ‘get_topic_subscription’ but the parse argument reverts to ‘get_forum_subscribe‘

  1. wrong parse call

this error is repeated for favorites in the same file
function bbp_get_topic_favorite_link
.......... 'get_forum_favorite_link' );

needs changing to ‘get_topic_favorite_link’`

  1. parse in bbp_get_topic_subscription_link redundant

This function calls bbp_get_user_subscribe_link which immediately resets all these parameters. This parse in this function should be removed to prevent false filtering

Attachments (2)

ticket2581.patch (1.1 KB) - added by Robin W 10 years ago.
bbPress-Sub-Parse-Args.php (1.8 KB) - added by netweb 10 years ago.

Download all attachments as: .zip

Change History (11)

#1 @Robin W
10 years ago

and yes, I'll add a patch for this, when I've looked up again how to do this !

#2 @Robin W
10 years ago

ok, so I've created a patch that

corrects the favorites parse name

takes out the subscription parse as this doesn't seem to be working. My php is not good enough to know why the call to bbp_get_user_subscribe_link( $r ) doesn't pass the $r args, but having a function with parse that simply goes to another function with the same (well one more arg) parse seems a bit redundant - anyway that's my argument !

If not some back with why it doesn't work, and I'll write a better one

@Robin W
10 years ago

#3 @netweb
10 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.6
  • Severity changed from minor to normal

The patch isn't quite right Robin, we will want to keep the bbp_parse_args and fix all instances of bbp_parse_args at the same time so they all work as expected which as noted they are most definitely are broken at the moment.

Forum Subscription Link bbp_before_get_forum_subscribe_link_parse_args
Topic Subscription Link bbp_before_get_topic_subscribe_link_parse_args
Topic Favorite Link bbp_before_get_topic_favorite_link_parse_args
User Subscriptionsbbp_before_bbp_get_user_subscribe_link_parse_args
User Favoritesbbp_before_get_user_favorite_link_parse_args

Note1: The bbp_parse_args filters above are roughly what we 'should' be using, not what we are currently using.
Note2: Testing is needed to make sure each bbp_parse_args works only where it is required.
Note3; Tested needs to include the default args in templates user-favorites.php and user-subscriptions.php

There is a bit of code shuffling that is required here, maybe not sharing the same functions in /src/includes/users/templates.php for the forum subs, topic subs and topic favs add build these links directly in their current functions in /src/includes/forums/templates.php and /src/includes/topics/templates.php respectively.

Attatched bbPress-Sub-Parse-Args.php is a hacky test plugin, again this won't work at the moment as some of the bbp_parse_args filter names are purely theoretical/fictional at the moment!

Moving to 2.6 and will take a closer look soonish.

#4 @Robin W
10 years ago

Thanks, still learning !

#5 @netweb
10 years ago

Original discussion here and related here on

#6 @netweb
10 years ago

  • Owner set to netweb

#7 @netweb
10 years ago

  • Summary changed from errors in includes/users/template to Topic and forum favorite and subscription filters

#8 @netweb
10 years ago

  • Milestone changed from 2.6 to 2.7

Punting to 2.7 to help get 2.6 out the door.

#9 @netweb
9 years ago

#2751 was marked as a duplicate

Note: See TracTickets for help on using tickets.