Mautic Community Forums

URL type custom field doesn't link

Hi, I’ve recently created a custom field in Mautic of type URL. It is populated via a SuiteCRM integration with a link back to the SuiteCRM contact record. The Mautic field is filling correctly with the proper URL HOWEVER the field in Mautic is NOT clickable/a link

Is this the expected behaviour OR is the URL field NOT a link

Mautic v.2.12.1
PHP 5.6.30 (what is the recommended PHP version?)

Where is it not clickable? In SuiteCRM or in Mautic?

I am sure the field type does not necessarily affect how the field is displayed in the browser (as hyperlink in your case) but for validation of the value when it is put in via form.

Hey Peter, thanks for the reply.

The link is not clickable ( the URL field) in Mautic… I just assumed if it was a URL type field it would be a hyperlink, if it’s not a hyperlink it might as well be a simple text field, Unless of course as you say it is used as some sort of validation when it is filled via a form submission… If that is the case, do you think the validation is present when you manually fill the Mautic field (e.g. when editing/creating a contact)… suppose I should just test it.

Would be useful to have a field that allows me to link directly from Mautic to the corresponding record in my CRM… do you know of any programmatic method to turn the content of the field into a hyperlink?

Thanks for any feedback you may have

I think I was wrong. I created an URL field and entered “sdfdsfsddsf” in it. After saving, it is displayed as “http://sdfdsfsddsf”. Very useful.

Although I don’t have a use case for this, you may want to enter a feature request in Github: https://github.com/mautic/mautic/issues

Hey Peter, I had tested the same thing - if you don’t have the leading http:// or https:// the field will add them HOWEVER, as I mentioned previously it’s not a hyerlink, so, from my point of view not very useful at all, I might as well have made it a text field.

Will do as you suggest I think, if it has logic attached to prepend the http://, not sure why the logic wouldn’t also create the <a href=" blah blah.

Thanks for your feedback

Sorry Marty, I was being ironic. How is a URL field useful if the input is not validated but only a “http://” is added? In my opinion not useful at all.

I would say your feature request should only affect how hyperlink fields are displayed on the GUI. In the background (database), the href… should not be added to keepp it clean.

HAH, funny…my apologies for not noticing the irony, think we may need to create an emoji for that :-]

Thanks for your continued feedback. Some code that formats the link before displaying it in the GUI but doesn’t affect the database content? Will be interesting to see the existing code, whether it strips the http:// https:// from any value entered before saving it to the database… the values that I’m synching from SuiteCRM contain the https:// and those values AREN’T changed in the GUI, probably a regex for http? if it exists leave alone, if not prepend…

Just to see what happens I added a value in the field that was an HTML formatted hyperlink (the whole <a HREF=blah blah) and it was automatically pre-pended with http://

Oh well, digging through code again - fun!!!

Cheers mate

Thought I might as well post a link to the solution that I have arrived at for this function

https://www.mautic.org/topic/add-an-entry-to-the-contacts-detail-view-right-hand-panel/

Hey Peter et al, this modification has been completed, see here

https://github.com/mautic/mautic/pull/5790