[buddypress-trac] [BuddyPress Trac] #8047: Some profile fields create empty links

buddypress-trac noreply at wordpress.org
Tue Feb 19 15:56:31 UTC 2019


#8047: Some profile fields create empty links
----------------------------------------+----------------------------------
 Reporter:  shanebp                     |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting
                                        |  Contributions
Component:  Extended Profile            |     Version:  4.1.0
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |
----------------------------------------+----------------------------------
Changes (by boonebgorges):

 * keywords:   => needs-patch good-first-bug
 * milestone:  Awaiting Review => Awaiting Contributions


Comment:

 Hi @shanebp - Thanks for diagnosing the problem in detail, and for
 proposing a fix.

 Regarding empty fields - you are totally correct that we should not be
 outputting empty links. If the field value is `''`, we should just be
 outputting an empty string.

 Regarding `do_autolink`. This setting is specifically intended to toggle
 the behavior where BP links the field value to a member directory search
 on that term. In other words, if the field is 'City', and I enter
 'Chicago', then `do_autolink=true` would result in 'Chicago' being linked
 to  `/members/?members_search=Chicago`. The text of the Dashboard setting
 is: `On user profiles, link this field to a search of the Members
 directory, using the field value as a search term:`.

 URL and telephone fields are different. Neither links to a directory
 search. URLs link to the intended URL, and telephone fields link to the
 `tel://` protocol - primarily so that they become links on mobile
 browsers. In both cases, I'd argue that the behavior is far more
 straightforward and generally desirable than the "autolink" behavior that
 `do_autolink` focuses on.

 So, I don't think it makes sense to obey `do_autolink` here. However, I do
 think that the following probably makes sense:
 a. Don't show the `do_autolink` dialog for field types where it doesn't
 make any sense.
 b. Introduce filters that allow the linking behavior to be disabled for
 the URL and Telephone field types.
 c. If we think that there's widespread need for it, we could introduce a
 metabox similar to the `do_autolink` metabox, but customized for each of
 the field types: "On user profiles, turn this field value into a clickable
 telephone link" or whatever.

 a and b seem like good changes and easy wins. I'm not convinced that c is
 worth the effort if we have the filters, but if someone wrote the patch, I
 guess it would be OK to include it :)

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8047#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list