Page MenuHomePhabricator

Implement a "Link" StandardCustomField
Closed, ResolvedPublic

Description

The previous grouping support patch I had applied also had the additional benefit of turning field values into links when they started with http:// and https://. Converting these to links automatically seems to make sense to me, unless there's some security concern I'm otherwise missing.

Event Timeline

Unknown Object (User) added a project: Maniphest.Sep 23 2013, 3:58 AM
Unknown Object (User) added a subscriber: Unknown Object (User).

In your use case, do these fields only hold links, or do they hold arbitrary text which might also contain links?

Unknown Object (User) added a comment.Sep 23 2013, 11:05 PM

They only hold links. The integration daemon we run synchronises the fields so that the fields link to the SharePoint item.

A couple of approaches spring to mind, then:

  1. We can let the Remarkup control have an 'inline' flag which renders it inline instead of in a block at the bottom; this will highlight the link as a side effect.
  2. We can write a "link" control which accepts a link. I think this is pretty reasonable to put in the upstream.
  3. You can also define your own "link" control externally now -- basically copy PhabricatorStandardCustomFieldText and dump it somewhere where it will load at runtime.

Any preferences here? (1) or (2) both seem reasonable to me, maybe with a slightly preference for (2). It sounds like they'd both fit the bill, but if you need more magic than those, maybe (3)?

With (1), you could sync some text like:

[[ http://sharepoint.whatever/29382389 | Sharepoint #29382389 ]]

...to get a prettier link, I suppose.

(2) sounds good to me. I don't like the idea of (1) because it would permit any form of Remarkup, and in this case we explicitly want to store a link in that field.

chad raised the priority of this task from Normal to Needs Triage.May 20 2014, 4:58 AM
chad moved this task from column2 to Backlog on the Maniphest board.
epriestley renamed this task from When a text field value starts with "http://" or "https://", it should automatically be converted to a link to Implement a "Link" StandardCustomField.May 24 2014, 12:51 PM
epriestley triaged this task as Low priority.
epriestley added a project: Custom Fields.
epriestley changed the visibility from "All Users" to "Public (No Login Required)".Apr 24 2015, 4:13 PM

FWIW It would be cool to have a list of links. We use a free text field for support cases (many external tickets:one internal ticket) which mostly working but sometimes people type random junk in the next block to celebrate their freedom.

people type random junk in the next block to celebrate their freedom

This company fully supports the jubilant celebration of human freedom.