Project:Image Assist
Version:4.7.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:benshell
Status:closed (fixed)

Issue Summary

Hello

I am trying to use the latest Img_assist for 4.7.0 in Drupal 4.7.0 RC 2.
It -almost- works, but there are two issues.

One, the image thumbnail previews do not show up in the img_assist window, which I guess is related to the "Table 'drupal.img_assist_map'..." error I'm seeing.

Full message:

Table 'drupal.img_assist_map' doesn't exist query: DELETE FROM img_assist_map WHERE nid = 34 in c:\website\includes\database.mysql.inc on line 120.

The more important issue for me is that images do not get inserted properly, using either 'Filter tag' or 'HTML Code' Insert mode.

"Filter tags" are not recognized at all and just show up as text on my pages... I have 'Input Format' set to Full HTML, is this incorrect?

and the HTML Code tags are written with an extra / in the file path, so the img src tags written by img_assist come out as
<img src="//files/image.jpg>

If I manually remove the extra / the images show up just fine on my pages.

I notice that the very last function in img_assist.module writes the tag

function theme_img_assist_legacy() {
return "<div class=\"%image-class\">\n  <a href=\"%node-link\"><img src=\"%src\" width=\"%width\" height=\"%height\" alt=\"%alt\" /></a>\n  <div class=\"caption\">%caption</div>\n</div>";
}

but it doesn't seem to add the extra / here, as it just calls %src

I'm not enough of a coder to fix this. Advice or a patch would be greatly appreciated, or if I just need to wait for the Image module to be fully 4.7.0 compatible, that'll do.

Also, I'm somewhat new to Drupal as a whole. If I should be asking this as a question in the Post Installation support forum instead of posting here, please let me know.

Thanks in advance.

Comments

#1

I have edited the 'file.inc' from the Includes folder

function file_create_url($path) line

return $GLOBALS['base_url'] .'/'. file_directory_path() .'/'. str_replace('\\', '/', $path);

and stripped the first / to create

return $GLOBALS['base_url'] .''.  file...

and now img_assist works perfectly

But this seems somewhat dirty and like it might break something else somewhere...

My base URL is ""; no "/".

... I'll keep looking... maybe the Image module is adding an extra "/" ??

#2

Category:bug report» support request

1) You're missing the img_assist_map table. This should have been installed when you enabled the module for the first time... however, the automatic install of tables is a new feature in Drupal 4.7, so it's possible that something went wrong here. Also, when I first released img_assist for Drupal 4.7 I was still including a img_assist.mysql file rather than the img_assist.install file. The important thing is that you get the img_assist table installed. The table structure hasn't changed in the 4.7 version, so the table definition for img_assist 4.6 will work.

2) You've set the input format to Full HTML, but have you enabled inline images for Full HTML? See the install file for details.

3) What is your File System Path set to (under Administer/Settings)? Also, what is your Default image path set to (under Administer/Settings/image)? Mine are set to "files" and "images".

4) Do you have any problems using the image module WITHOUT img_assist? Img_assist relies on the image module.

5) The theming function you're referring to is used used for legacy img_assist tags (those created with img_assist 4.6 and before).

6) I highly recommend you do not edit file.inc.

7) You're welcome to post things like this on the project pages (I'll probably miss it if you ask on the forums). However, I'd prefer you mark the issue as a support request unless you're sure it's a bug. There *could* be a bug related to this, I'm not ruling that out, but there are definitely some other issues that need to be fixed first before we can say that.

I hope this helps.

#3

Version:4.7.x-1.x-dev» 6.x-3.x-dev

I can verify an issue here. However, I'm not sure if the problem is that there is an extra slash in the path, or if the http: part is missing, because even if I was able to remove the extra leading slash, the path would be wrong because it is still incorrectly prepending the domain name "example.com" to the front. The best way to demonstrate what is happening is to show you the parsed markup:

Download method: Public
<img src="//example.com/sites/example.com/files/images/testfile.img_assist_custom.jpg" alt="" title=""  width="119" height="67" class="image img_assist_custom" />

Download method: Private
<img src="//example.com/system/files/images/testfile.img_assist_custom.jpg" alt="" title=""  width="119" height="67" class="image img_assist_custom" />

1) img_assist_map table exists.
2) Occurs regardless of Input Format (+inline image filter).
3) File System Path is set to "sites/example.com/files" (Multi-site install prevents just using "files"). Default Image path: "images". In addition it doesn't matter if I use public or private download method.
4) No problems using image module without img_assist.
5) N/A
6) Wouldn't think of it.
7) Pretty sure this is a bug.

The tricky thing about this bug is that Safari (my primary browser) isn't bothered by the borked path, and Firefox only bugs out sometimes even though the paths are consistently wrong as illustrated above.

#4

Version:6.x-3.x-dev» 4.7.x-1.x-dev

Thank you for your help so far. Glad to know I'm not posting inappropriately.

1-2) So, first the first part. I had indeed not had the img_assist_map table installed.
Easily installed by following directions, thanks.

3) System path is "files", Image path is "images", same as yours

4) The Image module is still working fine, as of the tweaks I've made, listed below. I can Create Image content type just fine, and the images show up properly.

As for the tagging issue, it seems related to Drupal's handling of base_urls.

I'd set my base_url to "" initially to fix an issue I was having with base_url set to "192.168.13.11:8080". I now realize the lack of "http://" was causing the problems.

Having my base_url set to "" was probably causing the extra "/" because Drupal was returning $base_url as " /" ... My "" plus it's automatic trailing /.

So, now, I've set base_url to "http://192.168.13.11:8080", which seems more in tune with Drupal and is not giving me my earlier problems.

However, img_assist is still not working, as it's prepending the "8080", creating <img src="8080/files/images/jpg.jpg">

I may have to do some tweaking of my Drupal installation... it doesn't seem like an img_assist bug...
If you have any suggestions, I'd appreciate them, though.

#5

Oh, and I did not have inline images enabled in the Input format types. "Filter tags" are now being recognized as well, though they do not work properly, either, I believe due to the "8080" issue.

I may try upgrading to RC 3 again, but it completely broke the site last time I tried.

Will post if I figure this out...

#6

Title:Extra / in HTML file paths. ALSO, "Table 'drupal.img_assist_map' doesn't exist"» Also think it's the http: missing

I was checking how my website was showing up in the RSS feed. All no problem except for the images. They all have the path //www.mydomain.com/files/images/filename.jpg, without the http: in front of it. For some reason, this is no problem for the site itself, but in the RSS feed this results in missing pics. Just put http: in front of them, and they show up.

When checking what the img_assist module generates as code, you can tell that it immediately leaves this peace of code out ...

#7

Assigned to:Anonymous» benshell
Status:active» fixed

I think I figured out this problem. Img_assist was passing the Drupal function theme_image() the full (correct) image path, but theme_image() was adding on the base_path() and then checking the URLs attempting to fix this broken URLs. Now I'm calling the image.module function theme_image_display() instead of the Drupal function theme_image().

#8

Status:fixed» closed (fixed)
nobody click here