Opened 10 years ago
Closed 7 years ago
#5926 closed enhancement (maybelater)
getting an activity permalink instead of a shortlink
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | needs-patch, trac-tidy-2018 |
Cc: |
Description
Our existing bp_activity_get_permalink
method returns the permalink for a single activity item, right? Actually, that's not true, because if you look at the function, it returns what I'd actually describe as a short link. For example:
bp_activity_get_permalink(567)
will return http://example.com/activity/p/567/
.
That URL will redirect to http://example.com/members/admin/activity/567/
.
I think bp_activity_get_permalink
should return the canonical permalink (the second link), not the first. It would be more intuitive, bring it inline with WP's get_permalink
which I'd guess many people who extend BP are familiar with, and finally give us a way to get the canonical link for a piece of activity content without having to dig into $_SERVER
.
If this proposed change is accepted, I suggest we rename bp_activity_get_permalink
to bp_activity_get_shortlink
, and build a real bp_activity_get_permalink
.
Attachments (3)
Change History (27)
#4
@
10 years ago
- Keywords has-patch added
5926.01.patch is what I'm suggesting. It renames bp_activity_get_permalink
to bp_activity_get_shortlink
, and bp_activity_get_permalink
is re-built to return the canonical URL instead. I've swapped some existing use out for the new shortlink function places where this function is used (where I think people might care) -- purely for aesthetic backwards consistency, rather than any technical reason.
This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.
10 years ago
#7
@
10 years ago
- Keywords needs-refresh 2nd-opinion added; has-patch commit removed
Have asked tw2113 for an 2nd opinion regarding phpDoc for the functions and actions.
This ticket was mentioned in Slack in #buddypress by tw2113. View the logs.
10 years ago
#9
follow-up:
↓ 11
@
10 years ago
My VCS-fu must not be strong enough yet, because I'm having trouble getting the patch to apply cleanly to an uptodate copy of trunk. I figure worst case scenario, I type up the phpdocs for the hooks that can be applied manually after someone with some more experience gets the patch refreshed.
#10
@
10 years ago
To add to that, [9194] reworked some of the innards of bp_activity_get_permalink as well, for example.
#11
in reply to:
↑ 9
@
10 years ago
Replying to tw2113:
My VCS-fu must not be strong enough yet, because I'm having trouble getting the patch to apply cleanly to an uptodate copy of trunk. I figure worst case scenario, I type up the phpdocs for the hooks that can be applied manually after someone with some more experience gets the patch refreshed.
It does not apply cleanly, probably because of [9194]. If you're able to refresh it, it'd be helpful. (This is a manual process - you'll have to manually merge the chunks of the patch that do not cleanly apply. No VCS-fu involved.)
#12
@
10 years ago
My question at this point is do we keep imath's version of bp_activity_get_permalink
for example, or do we need to discuss which direction the function goes going forward. I know Paul is proposing renaming it completely.
#13
@
10 years ago
- Milestone changed from 2.2 to 2.3
I don't think I'll have time to refresh the patch for 2.2, but I'll get it done for 2.3.
#15
@
10 years ago
5926.02.patch is refreshed for current trunk. The new bp_activity_get_shortlink
does duplicate most of bp_activity_get_permalink
, but I am struggling to think of a nice way of avoiding the duplication.
#17
@
10 years ago
I guess I could try adding another parameter to permalink() that sets whether to return the shortlink or not, and make shortlink() into a kind of wrapper.
#18
@
10 years ago
- Milestone changed from 2.3 to 2.4
I forgot about this. I'll commit to this for 2.4.
#19
@
9 years ago
- Keywords needs-testing needs-unit-tests added; 2nd-opinion removed
- Milestone changed from 2.4 to 2.5
I have refreshed the patch for current trunk so it applies cleanly (the since version is out of date) but one of the new unit tests is failing, and I think it's something to do with our test runner's go_to
function which is pretty gnarly (it might not handle redirects?), and I don't have time/desire to figure it out for 2.4.
#21
@
9 years ago
- Keywords needs-patch added; has-patch needs-testing needs-unit-tests removed
- Milestone changed from 2.6 to Future Release
This patch doesn't apply cleanly anymore, and last I knew, it was breaking the tests. Punting.
#23
@
7 years ago
- Keywords trac-tidy-2018 added
We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.
Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.
If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.
For more information, see https://bpdevel.wordpress.com/2018/01/21/our-awaiting-contributions-milestone-contains/
or find us on Slack, in the #buddypress channel: https://make.wordpress.org/chat/
In 9061: