#1 April 11, 2015 3:27pm

JayMoog
Member
Registered: April 11, 2015
Posts: 8

Slash missing on Import / Edit Image

In the latest Git, when I upload image file and place them on a new page, using "Unsert / Edit Image" the default URL is missing a slash.

I don't know if this is a configuration issue or a bug, but it's a fairly generic new install.

The url reads as
http://domain.bizfiles/resources/filename.jpg
rather than
http://domain.biz/files/resources/filename.jpg

Thus the image draws as a broken image link in the page.

Offline

#2 April 11, 2015 3:53pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Slash missing on Import / Edit Image

Does your static_root setting in /custom/environment.php have a trailing slash? Most of the time assets generate their URL relative to static_root or www_root, both of which you'll want to have a trailing slash on.

Offline

#3 April 12, 2015 3:22am

JayMoog
Member
Registered: April 11, 2015
Posts: 8

Re: Slash missing on Import / Edit Image

Hi,
Yes, assuming the environment.php file is being read correctly both static_root and www_root have a trailing slash.
The domain name does not.
J.

Offline

#4 April 12, 2015 10:03am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Slash missing on Import / Edit Image

Hm, that's really strange. What do the paths in the "file" column of the bigtree_resources table look like?

Offline

#5 April 12, 2015 10:16am

JayMoog
Member
Registered: April 11, 2015
Posts: 8

Re: Slash missing on Import / Edit Image

select file from bigtree_resources;
+-------------------------------------------------+
| file                                            |
+-------------------------------------------------+
| {staticroot}files/resources/muckleburgh-top.jpg |
| {staticroot}files/resources/tank-front.jpg      |
| {staticroot}files/resources/tank-strip2.jpg     |
+-------------------------------------------------+
3 rows in set (0.00 sec)

Offline

#6 April 12, 2015 10:19am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Slash missing on Import / Edit Image

Very strange, that's exactly what I'd expect. When changing those {staticroot}s into URLs BigTree literally just does a str_replace of {staticroot} to the $bigtree["config"]["static_root"] value.

Is there anything strange about your server setup? I've seen some random issues with Windows servers, but haven't seen this one before.

Offline

#7 April 12, 2015 10:34am

JayMoog
Member
Registered: April 11, 2015
Posts: 8

Re: Slash missing on Import / Edit Image

Server is Linux / Ubuntu 14.04.2
MySQL and Apache is as-bundelled
BigTree is from dist, though I also tried Git head with the same results, both installed is minimal and as per instructions as I'm no web programmer.

Any way of getting the value of static_root to print in a page to see how the edit/import dialog is seeing it?

Ah, hang on, that is strange.....
I just tried it again on a new page and the problem has gone away:  Client caching issue perhaps?
The slashes were missing from the install, I had to edit the config after install to correct the default URLs.  I had restarted apache several times yesterday.

Offline

#8 April 12, 2015 10:35am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Slash missing on Import / Edit Image

Might be! Glad it's working for you now.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.