I have used img_assist for quite a while, and find it very useful. I just upgraded to 4.7.5 (from 4.7.3) and decided to start with clean version of all modules. I just noticed that when img_assist pulls the image, the img src="http://mysite.com/system/files/img.jpg" rather than "/files/img.jpg", in otherwords, it is a full url rather than a url relative to the drupal base. I don't recall this being the case in the past and would like to change this back. Since I imagine there was a reason for this change (which I would love to hear about since perhaps I am missing something important), I am happy to override this in template.php rather than the module itself, but I am not sure the function that is called, and how the src is being defined. I went through the module, but my php is poor and I am not quite sure when it is that the base_path is being printed and used as src, or when it is being used as a reference for the module.

Any help would be very appreciated.
Thanks,
Maria

CommentFileSizeAuthor
#7 img_assist.abs2rel.patch1.45 KBsun

Comments

mariagwyn’s picture

sorry, forgot this: img_assist.module,v 1.56.2.18 2006/12/14
-m

themselves’s picture

I'm discovering this for the first time as well, and it's a big hassle - I have a dev, staging and live server, all 3 of which have different URLs. Has anyone had a look at this issue?

mariagwyn’s picture

Version: 4.7.x-1.x-dev » 5.x-1.1

I have upgraded from 4.7 to 5.1, and am using Image Assist 5.x-1.1. The code is still placing the image into the node with the full url (http://sitename.com/system/files/image.img). This is a MAJOR PROBLEM since I often build on development sites and then move to a live site. Every image that is put in a node via image assist then has the wrong 'http://sitename.com' in it. Can someone offer a suggestion, or a php snippet that will strip this function from image assist? I have been trying to think of scenarios where it would be crucial to have the full url inserted into the html of the page, but I can't think why it would ever be better than a relative url that utilizes drupal's administrator-set filepath.

Help? Please?
Maria

wessex’s picture

Yikes. I'm building a site on a test domain and this will be a major problem when it moves...

benshell’s picture

This won't be a problem when you move your sites as long as you're using the img_assist filter tag (and not inserting HTML code). Just clear your cache tables after you move your sites. The 'devel' module makes this really easy.

RSS feeds and "email this page" features are two reasons that absolute URLs for images are necessary. This really should be an option though, since I understand that not everyone needs or wants absolute URLs.

jaredwiltshire’s picture

This needs to be fixed.

Related issues (I think):
http://drupal.org/node/153844
http://drupal.org/node/113875

sun’s picture

Title: Img src is not relative » Absolute image src path do not work on multi-site setups
Version: 5.x-1.1 » 5.x-1.4
Assigned: Unassigned » sun
Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.45 KB

Either way, let's reword it and call it a bug. Most of our internal development sites are served through internal network and internet simultaneously. Images are only displayed on the url, on which a node update was invoked last.

Cached paths definitely should be relative.

Attached patch fixes this issue by removing calls to file_create_url(). I wasn't able to test private file download method.

sun’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)