I've just spent several hours testing HTMLarea and the image upload feature. I think it's one of best things I've seen yet! I hope it wil continue to work with 4.6. I can't imagine it getting much better for my non-techie clients. But... there are some bugs!

I have htmlarea 4.5.0 installed with upload image turned on and the version of image.module that is available in cvs sandbox/gordon. I tried out htmlarea cvs but got an error when I went to the settings page, so I rolled back to 4.5.0. I've tested this on 2 installations:

Installation A: installed in the root directory of an account which does not yet have the DNS propagated (i.e. http://domain.com/~username). Clean URLs are disabled.

Installation B: installed in a subdirectory (i.e. http://domain.com/drupal)

With Upload_image plugin turned on:

  • I can upload images and assign them to whichever category is selected in the category dropdown menu.
    • Installation A: I am returned to a refreshed view of the same window after clicking upload, with the path nicely entered for me.
    • Installation B: It takes me to a window that shows the node/add/image page successfully submitted. I have to then close the window and re-open it in order to continue adding the image to the story.
  • I can preview images only with Installation B - and only if clean urls are disabled. (I tried modifying the .htaccess file to specify my subdirectory, but that doesn't help. I can not preview images with Installation A. I wonder if it will start working once the DNS is propagated.

So, installation A uploads images nicely, and installation B previews images nicely as long as I don't use clean URLs.

Also, the image gallery has big problems:

  • The first page of the image gallery will work only with Installation B. I can't get it to work at all with Installation A. With Installation B, it seemed to start working when I set the "disable image cache" in the image settings to "enable" -- but then I disabled it again later and it didn't break. The default is "enable" and I'm not sure if disabling and then re-enabling would do the trick.
  • The image node pages themselves do not display an image at all. This is true on both installations, whether I add the image through htmlarea or through node/add/image. Clicking on various resolution sizes also produces no results.
  • Also odd, Installation A will display a user's image gallery (i.e. image/uid/1) if personal image galleries are enabled. It just won't show the main image gallery page (i.e. image) -- the page loads but it says "There are no images in this album."

With Upload_image plugin turned off, -both- installations will:

  • Return a "page not found" error when I use relative path for the image node: image/view/27 OR for the actual image file directory: images/name-27.jpg. The only difference is that Installation A returns a standard error page and Installation B returns the internal Drupal error page.
  • Return a preview of the Insert Image window itself when I use a relative path such as: ?q=image/view/27
  • Return a preview of the image itself if I use a full path (i.e. http://domain.com/images/image-27.jpg)

Can anybody tell me how to fix?! Will this work in CVS with drupal 4.5.0, and if so how can I get CVS working?

I hope this documentation helps save time for others, too...
-Samantha

Comments

sammos’s picture

Update - with Installation B, I forgot to apply the node.patch as instructed to do in the htmlarea install file. I applied it and that has resolved the issue of having to first upload, then close to select and add to the text area. So, now I have an installation that (since I don't need photo gallery or individual image pages for this site) works perfectly!

Now, if only I could keep my clean URLs and still be able to preview the image...

Ian Ward’s picture

I have a site installed in a sub-directory (domain.com/site) and using clean URLs. In the insert_image.php file I went to line 173

								<option value="<?php echo url("image/view/$node->nid") ?>"><?php echo $node->title ?></option>

and added ?q= like so:

								<option value="<?php echo url("?q=image/view/$node->nid") ?>"><?php echo $node->title ?></option>

This makes the preview work. Additionally, this inserts the path to the image w/ a ?q= prefixed, but this seems to work as a valid path to the image. I'm wondering how this can be fixed more...directly? I guess is there a larger picture underlying issue here? If I ever move this site out of a sub directory, this might break all my paths to images in pages, stories, etc?

gordon’s picture

what is the >base< set to. If this isn't set correctly then the relative tags will not work correctly.

You should not have to add the relative path to the url as this should be taken care of.

gordon’s picture

I have done some more investigation and found that there is something wrong with the <base> tag,

In normal drupal pages it is like this.

<base href="http://www.example.com/~user/">

where as in the UploadImage popup screen it is like this

<base href="http://www.example.com/~user">

I need to do some more investigation on what is going on here and work out why the "/" is not being added in.

Wesley Tanaka’s picture

There's a patch here: http://drupal.org/node/13148#comment-59330 (against 4.7)

which removes base href completely. if you're having issues with base href, you might want to show your support in that bug report's comments