Project

General

Profile

Actions

Bug #4402

closed

Github link needs full URL rather than ID

Added by Matt Gold over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Daniel Jones
Category name:
Public Portfolio
Target version:
Start date:
2015-08-08
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Most of the social media connections on our portfolio pages ask the user to add an ID. For Github, though, adding only an ID leads to an erroneous link that points back to the Commons domain. Adding the full URL works. If possible, users should only have to add their user IDs as they do with the other third-party connections we offer there.

Actions #1

Updated by Boone Gorges over 8 years ago

  • Assignee changed from Boone Gorges to Daniel Jones
  • Target version set to 1.9

Dan, can you look into this? The Github option in bp-social-media-profiles currently expects a URL, but it can be modified so that it works more like YouTube or Delicious.

Actions #2

Updated by Daniel Jones over 8 years ago

I ended up having to move a little beyond the scope originally laid out here. I hope that's alright. Changeset is here: https://github.com/cuny-academic-commons/cac/commit/d6a5851158260ed0caf05e7049e58c2d3bc10420

I found that the URL pattern I had added for the Github xprofile field, through the default array set up in site-data.php, wasn't registering, and saw that the reason was that it was trying to load the pattern from xprofile field metadata only. I modified the plugin to look for a pattern in the default array if one wasn't provided by the user/present in the database. I also modified the plugin slightly on the admin side so that even if a site field doesn't have a URL pattern yet, the user can add one in the xprofile admin interface. As it was, fields without URL patterns couldn't see the input at all.

Lastly - I added support for URLs that don't include the www. and that are missing http:// - hope that was okay, too. Just feel like it's the kind've thing that could leave a user scratching their head if they just typed in the url and didn't copy/paste to include those parts.

Actions #3

Updated by Boone Gorges over 8 years ago

Cool - thanks, Dan! Some comments:

I modified the plugin to look for a pattern in the default array if one wasn't provided by the user/present in the database. I also modified the plugin slightly on the admin side so that even if a site field doesn't have a URL pattern yet, the user can add one in the xprofile admin interface. As it was, fields without URL patterns couldn't see the input at all.

Thanks for fixing these. They were annoying bugs that I never got around to, because no one was using the plugin but me :)

I added support for URLs that don't include the www. and that are missing http://

No problem. For the case of Github in particular, it's https-only, so you could use https. That being said, http:// seems like the right choice for handling URL patterns in general.

I'm also going to leave a couple comments right on the changeset with specific requests.

Could I ask you to create a fork of https://github.com/boonebgorges/bp-social-media-profiles and send these changes as a pull request as well? Thanks :)

Actions #4

Updated by Daniel Jones over 8 years ago

Sure thing! Just did it.

Actions #5

Updated by Boone Gorges over 8 years ago

  • Status changed from Assigned to Resolved
Actions

Also available in: Atom PDF