Forum
Textile using site root relative paths
I recently updated a client's site to Perch 2.8.31 and they're having some issues with links. They use Textile on their text_block.html template and any links they add are being output relatively. So if they were to type "Yahoo":www.yahoo.com
the link would output as example.com/www.yahoo.com
. Adding https://
or https://
to the url breaks it entirely and just outputs the input verbatim: "Yahoo":https://www.yahoo.com
.
This wasn't the case until this update. They were updating from a pretty old version of the CMS, but I couldn't tell you which.
I've tried updating the version of php they're running from 5.4 to the maximum allowed 5.5 (the options in the control panel are limited to 5.3, 5.4 and 5.5) but that doesn't help. I also tried switching Textile to Markdown to see what happened and the links with https://
or https://
added worked ok but without this it still defaulted to relative.
I tried it locally and it worked fine. So the problem seems to be somewhere with the combination of the new version of Perch and their server. Do you know if this is something to do with some settings that might have changed in Perch's core that are less comprehensive in the servers they support? I've had a good delve in the CPanel setting but can't find anything. Also Google's not turning anything up. Do you know if this is something that might be able to be fixed in Perch or if it's their server that's at fault?
Thanks for keeping me right :)
Martin.
Can we see the Diagnostics Report and one of the templates where this occurs? Otherwise I can't really make a guess.
Did you update MarktItUp?
Hi Rachel, I've just double checked Markitup was up to date and it is. Here's my diagnostics:
So with both Textile and Markdown you do need to add a full link. you can't miss off the http or https (how would it know you didn't mean to make a site relative link?)
Are you saying that if you do add the http, this breaks something? What is there if you view source?
In Textile, this
"test":https://tempertemper.net
outputs this to the page when I view source<p>"test":https://tempertemper.net</p>
. In Markdown that outputs a link as expected:[test](https://tempertemper.net)
,<p><a href="https://tempertemper.net">test</a></p>
.In both Textile and Markdown without any http/s the link is being output on top of the site's URL:
example.com/tempertemper.net
. Normally I would only expect this to happen when the URL starts with a/
in Textile/Markdown, so"test":/tempertemper.net
or[test](/tempertemper.net)
.I've had a root around in the version history and the version I upgraded from was 2.1.3, if that helps at all. ( I found that in /cms/core/lib/Perch.class.php)
I can't reproduce that at all - it works perfectly here.
Yeah it's a weird one. Works fine on my local set up too. Shall I get my client to contact their hosting company, maybe?
I'm not sure what your client might ask them. Have you double checked that all the current files are deploying?
Sorry for the super late reply – last week turned very busy!
I've double checked the site files are identical to my local set up and can confirm they are.
What do you think I should do from here…?
I'm not sure how you (rather than I) would debug that.
Is it an option to switch the field to Markdown?
Yeah switching to Markdown would fix it. Though it'd need the
https://
bit which isn't quite the normal behaviour, but it's a fix. I'll speak to my client. Thanks for all your help on this one :)