Project

General

Profile

Actions

Bug #4565

closed

Invalid LinkedIn URL on profile

Added by Raffi Khatchadourian over 8 years ago. Updated over 8 years ago.

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

0%

Estimated time:
Deployment actions:

Actions #1

Updated by Boone Gorges over 8 years ago

  • Status changed from New to Assigned
  • Assignee changed from Boone Gorges to Daniel Jones
  • Target version set to 1.8.10

Thanks, Raffi.

Dan, could you look at this? I can't remember whether we normalize URLs on save or on display in bp-social-media-profiles, but in this case we will need a filter that modifies on display. Use regex that looks something like this:

if ( preg_match( '|(https?\://)?(www\.)?linkedin\.com/in/([a-zA-Z0-9\-\.]+)|', $field_value, $matches ) ) {
    $screen_name = $matches[2];
}

This is totally off the top of my head and completely untested, but it gives you an idea of what to look for (optional http/s, optional www., capture the screenname part of the URL).

Actions #2

Updated by Raffi Khatchadourian over 8 years ago

Boone Gorges wrote:

Thanks, Raffi.

Dan, could you look at this? I can't remember whether we normalize URLs on save or on display in bp-social-media-profiles, but in this case we will need a filter that modifies on display. Use regex that looks something like this:

[...]

This is totally off the top of my head and completely untested, but it gives you an idea of what to look for (optional http/s, optional www., capture the screenname part of the URL).

No problem. Note that LinkedIn URLs can either include http or https.

Actions #3

Updated by Boone Gorges over 8 years ago

No problem. Note that LinkedIn URLs can either include http or https.

I figured - thus the question mark after the s in my regex :)

Actions #4

Updated by Raffi Khatchadourian over 8 years ago

Boone Gorges wrote:

No problem. Note that LinkedIn URLs can either include http or https.

I figured - thus the question mark after the s in my regex :)

Ah! That would teach me to read more carefully before I reply. Sorry about that!

Actions #5

Updated by Boone Gorges over 8 years ago

  • Target version changed from 1.8.10 to 1.8.11
Actions #6

Updated by Boone Gorges over 8 years ago

  • Target version changed from 1.8.11 to 1.8.12
Actions #7

Updated by Boone Gorges over 8 years ago

  • Target version changed from 1.8.12 to 1.8.13
Actions #8

Updated by Boone Gorges over 8 years ago

  • Target version changed from 1.8.13 to 1.8.14
Actions #9

Updated by Daniel Jones over 8 years ago

Sorry about this - this was an error created from the last time I monkeyed around with BP Social Media Profiles. It should be fixed now.

https://github.com/cuny-academic-commons/cac/commit/a7dfae87380ff5d6211121d6614b2eed3771dddb

https://github.com/cuny-academic-commons/cac/commit/5f93e930820f89936514647ae378a55099b9512f

Actions #10

Updated by Boone Gorges over 8 years ago

  • Status changed from Assigned to Resolved

Thanks, Dan. These fixes look good.

It's pretty annoying that bp-social-media-profiles caches the concatenated URLs in the 'bp_smp_data' meta field. This caching means that changes like the one you've made here will only be applied when the user resaves the field. I assume I originally wrote it like this for performance reasons, but in retrospect, this was a bad idea :) I'm going to mark the current ticket resolved, and open a new one to look at implementing dynamic URL concatenation.

Moved to the 1.8.x branch in https://github.com/cuny-academic-commons/cac/commit/8559ad9c1f29244c0b4b702b2215ff2c64961f85, https://github.com/cuny-academic-commons/cac/commit/bef2000c3dbcec62910baf9f9f99cc1649c5be1d

Actions

Also available in: Atom PDF