Preventing relative upload paths in V2.09

12 posts by 3 authors in: Forums > CMS Builder
Last Post: June 14, 2011   (RSS)

By gadefgaertgqe - June 8, 2011 - edited: June 15, 2011

Hello :)

Yesterday I tried upgrading from V2.08 to V2.09 it went well apart from all the image urls being broken due to the relative upload path changes. Is there anyway to stop this from happening? Due to the complex nature of the CMSB installation I do not want this feature. Here are some examples:

Broken -
http://xxx.xxxxxxxxx.comhttp://xxx.xxxxxxxx.co.uk/uploads/promotion-images/200-tweet-125-discount-bann.jpg


Works -
http://xxx.xxxxxxxxx.com/uploads/promotion-images/200-tweet-125-discount-bann.jpg

When linking to images I have the domain (http://xxx.xxxxxxxxx.com) hard coded. It seems CMSB is detecting the current domain and inserting.

What is the best way of preventing this? Preferably without making changes to the actual coding of CMSB.

Thanks

Paul

Re: [Pixels & Beats] Preventing relative upload paths in V2.09

By Jason - June 8, 2011

Hi Paul,

If you could fill out a [url http://www.interactivetools.com/support]2nd Level Support Request[/url] and we can take a look.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Preventing relative upload paths in V2.09

Done. Sorry for the delay but it's the workload here is stupid. Thanks Jason :)

Re: [Dave] Preventing relative upload paths in V2.09

Hi Dave,

I seem to have no record of the ticket number. They normally get emailed after filling out the form don't they? Just checked all email folders and got nothing atm.

I am happy to fill out another one if required. Our net connection has been a bit iffy today....

Re: [Pixels & Beats] Preventing relative upload paths in V2.09

By Jason - June 10, 2011

Hi,

I found your request in our support queue and have forwarded the information all to Dave.

We'll be looking into this issue and should have an update for you soon.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Preventing relative upload paths in V2.09

Thanks Jason!

Re: [Pixels & Beats] Preventing relative upload paths in V2.09

By Dave - June 10, 2011

Hi Paul,

Ok, I think I've identified the issue. When you have a custom upload path/url set for a field it adds the hostname to the thumbUrlPath, etc fields.

Can you try this custom change?

- Open /lib/upload_functions.php
- Search for realUrl (around line 533)
- Replace this:
if (!isAbsoluteUrl($uploadUrl)) {
$uploadUrl = realUrl($uploadUrl, $SETTINGS['uploadUrl']);
}


- With this:
if (!preg_match("|^/|", $uploadUrl)) {
$uploadUrl = realUrl($uploadUrl, $SETTINGS['uploadUrl']);
$uploadUrl = preg_replace("|^\w+://[^/]+|", '', $uploadUrl); // remove scheme://hostname
}


Let me know if that works for you. If so we'll include it in 2.10.

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Preventing relative upload paths in V2.09

Hi Dave,

Sorry but I rolled back the website to version 2.08 as it is a live national site. I really need to look into setting up a live test area, but due to the pressures I am under this has not yet been possible.

Is it OK to duplicate a CMSB install /setup using the same product code for test purposes? If so I will try and do something this week as it will help us all. Especially when you have got back so quick with a potential solution!

Kind Regards

Paul

Re: [Pixels & Beats] Preventing relative upload paths in V2.09

By Dave - June 13, 2011

Hi Paul,

Yes, we'd call that a "staging" install. and staging or test installs are fine and allowed by the license agreement.

Let me know how it goes and anything else I can do to help. Thanks!
Dave Edis - Senior Developer
interactivetools.com