Welcome to Geeklog, Anonymous Saturday, September 07 2024 @ 08:02 pm EDT

Geeklog Forums

Bug? Pictures in articles not dynamically referenced...


Status: offline

JoelF

Forum User
Chatty
Registered: 07/18/04
Posts: 39
I just noticed that when you add a picture to a submitted article, it seems to 'hard-code' to the server url at the time that the story was submitted... I did some testing on a notebook with the server URL set to http://localhost/gl (so that I could work anywhere without having to reset the IP).

Then I set the machine URL to its real IP address, and found that when I tried to view the site from another machine - the site in general worked, but the links to the articles' pictures were broken.

Checking the page source from a remote machine, I found that the links to the pictures in the articles were still listed as "http://localhost/" rather than resolved to the machine URL - even though I had now set the address in config.php to the real address.

This suggests that these links are not respecting the config.php settings, and are getting statically set when the article is submitted instead of generated at runtime. Am I missing something here? Seems like a design bug maybe?

Thanks,

Joel
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yes.

bye, Dirk
 Quote

Status: offline

JoelF

Forum User
Chatty
Registered: 07/18/04
Posts: 39
Quote by JoelF:
This suggests that these links are not respecting the config.php settings, and are getting statically set when the article is submitted instead of generated at runtime.


It looks like the address is getting resolved when the article is saved, and the "[imageX]" tags are getting replaced at that point by the address from config.php. If this is the case, it would mean editing every article by hand if things move from server to server. Maybe this could be a runtime function, and leave the [imageX] tags in the article definition as-is?

Just a thought,

Joel
 Quote

Status: offline

JohnVanVliet

Forum User
Full Member
Registered: 10/09/03
Posts: 161
ignore post
 Quote

Status: offline

JoelF

Forum User
Chatty
Registered: 07/18/04
Posts: 39
Quote by JohnVanVliet: over the last 3 years i have found that using " localhost" for a url is very,very,very,very, bad idia . Unless it is for testing ONLY


It -was- for testing only! The problem with not using localhost is that if you're often on multiple networks with DHCP, it then means changing your config.php every time you move. Not that it's a -huge- thing, but it didn't seem that it should be necessary.

The other use case where this is a real problem is:
- User has gl installed on xyz hosting provider.
- User moves to another provider that hands out a different URL (or user decides to change domain name, or user wants to run a test server and a production server etc etc)
- Any one of these scenarios look like they'll break the picture links -in- articles, but all the other graphics links are just fine - this seems to be an isolated bug, but one that could cause 'lots of work and unhappiness' if you happen to fit the scenario.

Are there other things I should watch for in the GL config?

Thanks,

Joel
 Quote

All times are EDT. The time is now 08:02 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content