Opened 11 years ago
Last modified 10 years ago
#2581 new defect (bug)
Topic and forum favorite and subscription filters
Reported by: | Robin W | Owned by: | netweb |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | needs-patch |
Cc: |
Description
bbpress/includes/topics/template.php has errors
- 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‘
- 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’`
- 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)
Change History (11)
#2
@
11 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
#3
@
11 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 Subscriptions | bbp_before_bbp_get_user_subscribe_link_parse_args
|
User Favorites | bbp_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.
and yes, I'll add a patch for this, when I've looked up again how to do this !