Im having an issue when I move my site and image urls become broken. For the node view I can fix this with Pathauto, but this doesn't fix the node edit view.
Ive read a few posts about using a patch to make this module use relative paths. Will this solve the problem? What if the page's url changes from say site.com/page1 to site.com/archive/page1, will the links break again?
This is a real issue for me as im working in a very agile way so im frequently moving the site from my development environment to a server to allow the client to add content, but making a new copy each time eg mysite.com/dev/client-site-v1 and then mysite.com/dev/client-site-v2.
Really pulling my hair out over this! Any help much appreciated. Thanks
Comments
Comment #1
quicksketchIn your situation, using relative links will not help because even then, links are only relative to the root of the server. If Drupal is installed in a different directory name based on dev/production, there's no consistent way for Insert module to generate URLs that will work on both servers.
The only solution I think you have available is to use Pathologic module to rewrite the contents of your fields so that URLs will work on both servers.
Comment #2
jdln CreditAttribution: jdln commentedSorry for the late reply. I found this post as ive run into the same issue again.
With pathologic I can clean up the output so the node view will work fine. However, when you edit the node pathologic hasnt done anything yet so the preview of the image is wrong. Is there no solution to this? Thanks
Comment #3
quicksketchGenerally, no. I'm not aware of one. I would try to develop a workflow where you're not moving content from the development server, or set up your development server to use a path structure that matches production. It's not difficult to change your localhost from being
http://localhost.com/example.com
tohttp://example.local
(that's what I do). Or if the dev server is remote, set uphttp://dev.example.com
. That way your path structure matches on localhost/dev/live.Comment #4
Snater CreditAttribution: Snater commentedSee also https://www.drupal.org/node/2401417#comment-12122968