Symptoms

When I click on my image assist icon within the TinyMCE editor, I get a pop-up window with the following error:

<b>Not Found</b>
The requested URL /sites/upgrade.tsldev.org/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.37 Server at upgrade.tsldev.org Port 80

If I use the image assist icon at the bottom of the page, without TinyMCE, it works fine.

A little background

  • I'm testing my upgrade to 5.1. The rest of the site appears to be functioning (at least as far as I've seen).
  • I downloaded the latest TinyMCE from moxicode - which is version 2.1.0. I know that the drupal Tinymce instructions and the Image Assist instructions describe version 2.0x, but I'm assuming the instructions are out of date. But, maybe not. Maybe Image Assist is out of synch with the current version of TinyMCE.
  • I also copied the Drupalimage plugin directory from Image Assist to the TinyMCE plugin directory and modified the plugin reg php file per the install instructions in Image Assist.
  • I ensured that the Image Assist plugin was turned on in the TinyMCE settings (as is evident by the fact the icon is in the editor).

I'm not sure if this is an installation/configuration issue or if it's a bug / version compatibility issue. Thanks in advance for your assistance and sorry my programmings skills are rusty or else I'd try to debug this more on my own.

CommentFileSizeAuthor
#18 img_assist-123203-070905.patch2.57 KBzoo33

Comments

darren oh’s picture

There is a workaround for this bug: move tinymce and img_assist to the core modules directory.

darren oh’s picture

Category: support » bug
gtaylor’s picture

Thanks much for the quick follow up. The work around worked fine.

For clarification, my understanding is that it's better form to keep the contributed modules completely separate from the core modules. That's why I had it in the site directory.

Is that not true in 5.1?

zoo33’s picture

That's right, adding contributed modules to the core modules directory isn't optimal, but it's not exactly wrong either.

On my testing server this is actually working flawlessly. Can we nail down what circumstances cause this behavior? Is there a way to fix it?

I'm using the latest Image assist (DRUPAL-5) and TinyMCE (HEAD), PHP 5 and Apache 2, with Drupal in a subdirectory and with clean urls.

zoo33’s picture

Forgot to mention that I keep my contrib modules in sites/all/modules.

darren oh’s picture

Title: index.php not found when using image assist plugin in TinyMCE editor » TinyMCE plugin works only in main modules directory

On my test site even the button was not displayed until I moved tinymce and image assist to the main modules directory.

gtaylor’s picture

Sorry for the delayed response.

Per the 5.1 status report, I have the following configuration:

  • My database schema is up to date
  • MySql 4.1.21
  • PHP 4.4.4
  • Apache/1.3.37 (Unix)

Additional system information per Site5, my hosting provider:

  • Linux kernel version 2.6.9-42.0.8.ELsmp
gtaylor’s picture

Oh yes, and due to historical legacy issues clean url's are NOT on.

I'm considering turning it on though as part of this upgrade. But need to test a few things out first.

darren oh’s picture

Category: bug » support

After I dropped all my database tables and reinstalled Drupal, I was able to disable tinymce and img_assist, move them to sites/all/modules, re-enable them, and use them with no problem.

gtaylor’s picture

Did you export and re-import your database, or start with a fresh install?

I need this to work on an upgraded db.

I think I also spoke to soon when I said the work around was working. When I try to add an image while using tinymce, I get the appropriate buttons & pop-up with the browse/upload/cancel options. I select an image fine, but when I hit the insert button, the pop up shows me my homepage with the image assist browse/upload/cancel options again.

Image assist is working fine when I disable Tinymce.

My users really need this feature...

gtaylor’s picture

one more piece of information.
I'm on a mac and I download and unzip the module files locally, rearranging directories as appropriate before FTP'ing them to my hosting provider.

should that cause issues?

zoo33’s picture

Are you using the latest version of img_assist? I'm just checking since the homepage problem sounds like something that has been solved...

No, unpacking on a Mac shouldn't cause any problems. Not on OS X anyway.

gtaylor’s picture

Yes osx.

My version shows v 1.14.2.1 2007/02/21 in the install text file. Looks like there's a new version out there today. I'll retry with that soon and will update here appropriately.

Thnx much!

gtaylor’s picture

the mar-6-07 5.1 download does NOT have the home page issue, but still is only working in the core modules directory. I even tried it in the sites/all/modules directory and still had my same original issue.

I'll go live with the work around.

Thnx again

darren oh’s picture

In response to comment #10, I should mention that I use Mac OS X 10.4.8 and have the same issue with images not being inserted when I use Safari. Firefox works fine. I don't think any of the TinyMCE image insertion plugins work in Safari.

gtaylor’s picture

I use firefox, two of my most active users use safari...

I'll check back for more fixes...

jasoncd’s picture

Using a brand new Drupal 5.1 install on IIS6. I put all modules in sites\all\modules. When I click the drupalimage plugin button, I just get the popup with a 404, trying to access sites\all\index.php. Firefox and IE both tried. When I used Drupal 4.7, i put modules in modules/contrib without any problems, to easily identify which modules I added.

zoo33’s picture

StatusFileSize
new2.57 KB

This is strange actually. As found in #153844 the current version of drupalimage expects that TinyMCE is in the modules directory, and if it isn't, it tries to load Image assist from sites/all/index.php?img_assist/load/tinymce. That shouldn't work, but it seems that in some cases, like mine, it does. Not sure why.

The issue arises from the way editor_plugin.js tries to find the base path to the Drupal installation. Right now it grabs the installation path of TinyMCE, which is defined in the TInyMCE object, and then cuts off everything beginning with "modules". It's not a very pretty solution. There is already a much better solution available within the module. img_assist.module defines a BASE_URL variable in a script tag on each page, so there's no reason not to use that instead.

I made a patch which uses BASE_URL in the drupalimage js-files and also cleans up the way BASE_URL is defined. The result is a lot cleaner and I don't really see any reason not to commit it right away. Will probably do so soon, but please take a look at it if you have time. If you test it, make sure to clear your browser cache.

zoo33’s picture

Status: Active » Needs review
keve’s picture

Just subscibing to this issue...

zoo33’s picture

Status: Needs review » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)
cgjohnson’s picture

I am having this problem in D6. Help?