Forum

Thread tagged as: Problem

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.

Martin Underhill

Martin Underhill 5 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

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:

Perch: 2.8.31, PHP: 5.4.23, MySQL: 5.1.73, with PDO
Server OS: FreeBSD, cgi-fcgi
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
PERCH_LOGINPATH: /cms
PERCH_PATH: /usr/home/wom126/www/htdocs/cms
PERCH_CORE: /usr/home/wom126/www/htdocs/cms/core
PERCH_RESFILEPATH: /usr/home/wom126/www/htdocs/cms/resources
Image manipulation: GD
PHP limits: Max upload 11M, Max POST 12M, Memory: 128M, Total max file upload: 11M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
DOCUMENT_ROOT: /usr/home/wom126/www/htdocs
HTTP_HOST: www.womeninlogistics.org
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Rachel Andrew

Rachel Andrew 394 points
Perch Support

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)

Drew McLellan

Drew McLellan 2638 points
Perch Support

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?

Drew McLellan

Drew McLellan 2638 points
Perch Support

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…?

Drew McLellan

Drew McLellan 2638 points
Perch Support

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 :)