Skip to:
Content
Pages
Categories
Search
Top
Bottom

Extended profile fields are adding spontaneous/inncorrect links to data


  • Susan Braiden
    Participant

    @sbraiden

    I’m using Commons-in-a-Box 1.0.9 on a WordPress 4.1 self-hosted site. While I was using the native Infinity theme this past year, I’ve recently switched to the WPMU Dev “Studio” theme.

    I’ve started to use the BuddyPress Extended Profile Fields and groups, and find them incredibly useful. I’m running into an odd problem, however, on data entered into 2 types of fields:

    1) fields assigned with the URL type – they never show up once data is entered.

    2) text fields – data entered is being displayed with links added to words and phrases, linking to them as members.

    The latter issue has me baffled. There seems to be no rhyme or reason to what it’s picking out of the data to add links to, or why.

    Has anyone else come across either of these field issues before? If so, how did you solve them?

    Thanks a bunch for any wisdom folks might be able to share in helping me troubleshoot this!

    Sue.

Viewing 9 replies - 1 through 9 (of 9 total)

  • danbp
    Participant

    @danbp

    Hi,

    The 5 first words in a textarea content are linked by default, as those in any other form items. This is made to let user find others using the same words.

    Sounds stupid for a bio or a phone number area, but becames very usefull if you have a custom field City or Hobby.

    The good news, is that you can deactivate this, globally or conditionally.

    Add this snippet to bp-custom.php or child theme functions.php
    This will remove ALL links only.

    function bpfr_remove_xprofile_links() {
        remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
    }
    add_action('bp_setup_globals', 'bpfr_remove_xprofile_links'); 

    ckchaudhary
    Participant

    @ckchaudhary

    fields assigned with the URL type – they never show up once data is entered.

    Must be something in your theme/plugins. It works by default.

    text fields – data entered is being displayed with links added to words and phrases, linking to them as members.

    Yeah buddypress does it deliberately. The purpose is to show/search all members who have entered same value in any of the fields.
    You can disable it by adding following line of code in bp-custom.php or in your theme’s functions.php:
    remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );


    Susan Braiden
    Participant

    @sbraiden

    @danbp and @ckchaudhary — thank you so very much for both the assistance, and for actually providing code to fix this! That was incredibly generous.

    Regarding the suppression of URL fields, I’ll need to do a bit more digging on that. It may be my theme sanitizing it.

    Regarding the linking: sometimes it is picking the first 5 words in a field, but often not. It seems to be grabbing words and phrases from all over the place (middle of a paragraph, multiple places in a paragraph, end of a paragraph). The odd thing is that there is no other context to link to, as I am the only one using it thus far. Rather curious and very random, especially given the fact that the links it’s creating treat the words/phrases chosen as “users”. Not certain what the purpose of that is, but guessing I am missing something.

    Thanks again for the assistance! Going to implement this straight away.

    Keeping a warm thought,
    Sue.


    Susan Braiden
    Participant

    @sbraiden

    Brilliant. That worked like a charm! The links are now gone. @danbp and @ckchaudhary – I thank you again for your help.

    Regarding the links, I took a closer look and was able to see what you were talking about. While it was simply linking back to my own profile, I could see the syntax seemed to be trying to do a search, which went back to absolutely nothing. Still unclear why it chose the words and phrases that it did, since there was nothing else to match them to, but happy to have been able to turn it off so easily.

    Thanks again, very much!
    Sue.


    danbp
    Participant

    @danbp

    Hi @sbraiden,
    if you enter love,apple,pie it’s considered as a list, because words separated by commas are list eleents in form (extended profile fields are in a form). If you enter i love apple pie and muffins, but also spaghetti. it’s mostly not linked, except for one of the words before a ponctuation. Or the first word, or the last word in other case. I’ve never tested this precisely.

    For the URL not showing, do you use the URL field type ? Have you tried with a single line textarea, just to see if this makes a difference.

    Also important to know, when you enter an URL on front-end (field type URL on), you have to enter the full URL, http included. If you enter only http://www.sometinhg or example.com, it’s not valid and will be linked like other words to user profile.


    jessiewordpress
    Participant

    @jessiewordpress

    I was so happy to find this solution! But, I am still confused. I tried to put what @danbp said into my child theme and it didn’t change anything.

    So I tried what @ckchaudhary said, and it didn’t change anything.

    and then I tried both, and it didn’t change anything.

    Thanks for helping.


    danbp
    Participant

    @danbp

    hi @jessiewordpress,

    do you use a cache ? If yes, clear it.


    jessiewordpress
    Participant

    @jessiewordpress

    Yes, thanks. It actually links every word now. Weird.


    jessiewordpress
    Participant

    @jessiewordpress

    any ideas?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Extended profile fields are adding spontaneous/inncorrect links to data’ is closed to new replies.
Skip to toolbar