Jump to content

[SOLVED] Getting duplicate "mailto:mailto:" result when email links are rendered on one field


MarcC
 Share

Recommended Posts

Hi All,

I'm looking for some tips to troubleshoot this issue with mailto links:

  • Issue: All email links in the body field are rendered on the website as "mailto:mailto:" with a duplicate prefix. This duplication is not shown inside the editor's "Source" window.
  • Other fields, like the sidebar field, do not have the issue.
  • I removed the body field's Hanna Code formatter and other text formatters, turned off ProCache, and this did not change anything.
  • I rendered the body field from Tracy Debugger's console and did confirm that the duplication is happening there.
  • I checked the DB itself, and there is no duplication in the HTML inside the DB.
  • I can't see any HTML Textarea plugins that would affect email links.

Any tips on troubleshooting this further? The site is currently running 3.0.200. Thanks!

Link to comment
Share on other sites

That's definitely an interesting one based on what you've already provided. My first thought would be some sort of custom TextFormatter but you've already tried removing that. Even more confusing considering the rendering within TracyDebugger is showing the duplication.

Silly question: You weren't working on a local/dev version but checking updates on a live/production version, right? ProCache was most definitely completely off, and any saved caches were cleared? Field-level caching was not enabled on the body field?

Is the body field a standard textarea/CKEditor/TinyMCE field, or is it part of a Repeater(Matrix)?

  • Like 1
Link to comment
Share on other sites

On further investigation:

One of the site's main templates was using a preg_replace function to automatically convert plain email address text into links.

The situation has been remedied by removing this until I can look into it further and decide whether to modify the code.

No more duplicate prefixes! Hooray.

I actually stumbled upon the issue while checking where I was using the separate HTML Purifier class in the template code. So a bit of luck helped in the investigation...

Thanks all for your ideas & input!

  • Like 1
Link to comment
Share on other sites

  • MarcC changed the title to [SOLVED] Getting duplicate "mailto:mailto:" result when email links are rendered on one field
24 minutes ago, BrendonKoz said:

@MarcC If/When you get a chance to look into it again: How was Tracy duplicating the behavior if it was template-based rendering?

I would also like to know! Tracy stopped showing the unwanted behavior after the template code was updated.

So, I wonder if Tracy is not completely isolated in the case of the console, and in fact attempts to access the body property as it comes out of the template processing. This seems like it could be meant as a convenience.

Just an idea though! I guess it would have been nice to know it was doing that. 😄

  • Haha 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...