Hi All,
Seems that there is an incorrect path to index.php when loading the drupalimage TinyMCE plugin. I have TinyMCE + Drupal image loaded under /sites/sitename/modules as I have a multisite setup, and it seems that when the drupalimage plugin is loading it is appending sites/sitename as the base url instead of the actual base url specified in settings.php
I have Apache and IIS running on the same machines, and this is what their logs show.
IIS 6 Log;
GET /sites/test.domain.com/index.php q=img_assist/load/tinymce
Apache 2 log;
GET /sites/test.domain.com/index.php?q=img_assist/load/tinymce
Weird thing is that in IIS this produces a 404 error and drupal image does not load, however it actually seems to load properly in Apache despite the path being incorrect.
Comments
Comment #1
brashquido commentedI think I have found the bug, but need some other people to verify it for me.
In drupalimage/editor_plugin.js on line 44, you should see this;
template['file'] = base_url + 'index.php?q=img_assist/load/tinymce';Change it to this;
template['file'] = 'index.php?q=' + base_url + 'img_assist/load/tinymce';It seems the bug was caused because the base_url was being placed infront of index.php instead of between index.php and the img_assist path.
Comment #2
dustyketchum commentedI'm running IIS and haven't had this problem until recently. I tried this patch a few weeks ago just for grins, didn't seem to make any difference - at the time I was troubleshooting getting img_assist running. I got it running, but haven't added any pictures since day one. Now that I'm trying it again, the wheels fell off...
// $Id: img_assist.module,v 1.62 2006/05/12 09:56:38 pangloss Exp $
Now I have this problem - 404 errors when I click the camera icon in tinymce - and I can't seem to fix it. This patch doesn't seem to make any difference. I have a test instance of drupal, and img_assist is working there. Copying my production mysql database to the test instance doesn't break img_assist, so presumably it is another change outside the database. I've tried undoing and redoing this fix - no help. I am using clean_urls on the production server only (can't figure out how to cleanly run them on the test instance as well); turning them off doesn't help. I've just compared directory trees of production (broke img_assist) with test (working img_assist) with winmerge and found almost nothing different...
IE shows a simple 404 error in a new img_assist window
Firefox shows my entire home page, including sidebars, with a 'page not found' in the middle... cute.
GET /modules/tinymce/tinymce/jscripts/tiny_mce/themes/advanced/index.php q=/img_assist/load/tinymce 80 DOMAIN\user 10.0.0.169 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+2.0.50727;+.NET+CLR+1.1.4322) 404 0 2
Not sure I understand why there are both editor_plugin_src.js and editor_plugin.js files - I've tried changing them both to no avail & also restarted IIS
Production home is
http://snoopy/
Test home is
http://snoopy/test/index.php
Any ideas would be appreciated.
Thanks,
Dusty
I also have discovered another probably unrelated problem with img_assist - at times my pictures do not display on my web pages - only white space where the picture should be, easily visible since there's text around it and the text is in the proper places (weird!). After spending hours looking at code I assume it is due to the drupal cache. When I started troubleshooting, I'm sure I tried editing the pictures to see if the image came back, and it didn't work (or so I'm remembering). I found recently that editing the pages DID fix my pictures so they reappeared. This problem IS related to the database - I can take a copy of the 'bad' database with whitespace where pictures should be and place it on my test instance to recreate the problem at will.
Comment #3
dustyketchum commentedI don't think the patch works... this now works for me with firefox but not IE on my production site... I'm still trying to make sense of the IIS logs, perhaps I'll have more later.
My clients are Winxp SP2 fully patched, latest version of IE. I'm using latest version of firefox only to see if problems I'm having with drupal are IE related - this is the second issue this week that works on firefox and not on IE.
I do know this somehow worked before on IE cause I didn't have firefox loaded anywhere before.
Comment #4
brashquido commentedI'm now using Drupal 4.7.2 and the lastest 4.7 versions of image, img_assist and TinyMCE and I can't seem to replicate this issue I had earlier on a 4.7.0 / Win XP SP2 / IIS 5.1 system. I've checked the editor_plugin.js code and it is unchanged, so I am a little baffled as to why it is working now.
Dusty,
Getting the Drupalimage plugin to work with TinyMCE is pretty simple, but it is not automated at meaning you'll have to copy/edit files manually. I had it going and working in 5 minutes using this basic checklist;
1) Install image, img_assist and tinyMCE
2) Copy "drupalimage" directory from img_assist to [code]modules\tinymce\tinymce\jscripts\tiny_mce\plugins[/code]
3) Follow drupalimage install instructions located in modules\img_assist
4) Set access permissions for TinyMCE and create new profile with drupalimage selected
5) Create a new node and drupalimage should now be working.
Comment #5
dustyketchum commentedbrashquido,
I've created another bug report for my 2nd issue.
http://drupal.org/node/68811
I assume my first issue is javascript related since it works on firefox and not on IE. I had tincymce & image assist working, it just decided to stop working for IE...not sure if it is the same as your issue.
thanks,
Dusty
Comment #6
drasgard commentedI was getting the 404 errors, and tracked the problem down to line 43 (not 44 as mentioned in earlier posts) of editor_plugin.js
I'm running multiple sites off a single drupal install, so the base_url needed to be stripped back a bit further than was being done...
I replaced:
base_url = base_url.substring(0, base_url.indexOf('modules'));
with
base_url = base_url.substring(0, base_url.indexOf('sites'));
now have img_assist, tinymce and drupalimage working nicely together on drupal 4.7
Comment #7
teddyc commentedI got the same 404 Problem and try to fix it in drupalimage/editor_plugin.js (see.Thread #1), but somehow it doesn't help me further.
With a new drupal site i have installed all of my image-insertion-set (image image_assist tinymce)
instead of folder
/sites/default/modulesin folder
/modulesThen it works fine.
I think it's a bug
the solution from drasgard (#6) looks pretty good (hmmm, drasgard, why didn't you see it 2 weeks ago ?)
Comment #8
darren ohComment #9
sunSee solution in #7.
Comment #10
(not verified) commented