[I'm green to adding mods, so forgive me if this is not quite perfect form.]

image.module has a '/' entry which creates a double trailing slash on the temporary file location. This error shows up in the cron logs, but doesn't stop the module from working. Apparently it does impact a cron process. If you yank the code, it works fine.

Line 125 of image.module
$path = variable_get('image_default_path', 'images') . '/temp';

Change to
$path = variable_get('image_default_path', 'images') . 'temp';

Removing the preceeding slash solves the problem. I'm not sure why or when the slash gets added in - likely the 'image_default_path', 'images' - I know it must add the slash before images, likewise it might logically do the same before 'temp'.

This may be due to a pecurliar setting on my Drupal site.

CommentFileSizeAuthor
#2 image-cvs-28248.patch1.45 KBRobrecht Jacques

Comments

5dayapp’s picture

Line 637 adds an extra trailing slash to the images directory. I'm not sure which one should be yanked, the first or second entry of the trailing slash (or preceeding slash), but one should be removed by whomever knows best.

Robrecht Jacques’s picture

Status: Needs work » Needs review
StatusFileSize
new1.45 KB

The 'image path' you fill in on the image settings page should NOT have a trailing slash (/).

So you should NOT change:
$path = variable_get('image_default_path', 'images') . '/temp';
to
$path = variable_get('image_default_path', 'images') . 'temp';
but rather change your setting. It should just say: "images" (which is the default), not 'images/'.

Can you check if you have a trailing slash in your 'default image path' setting? And whether removing this trailing slash (/) solves the problem?

Although this is not a bug (at least I don't think so), wouldn't it be more "userfriendly" if _image_filename removed the trailing slash from the 'image_default_path' variable before creating the path? Same with image_cron.

A proposed patch is attached for CVS.

5dayapp’s picture

I've corrected my problem with my changes. What's the web path to the admin interface. It's not admin/image and it's not listed in the links under administer. Perhaps there's a setting I'm screwing up and trying to fix through the module. [But, I didn't set anything - so it's the default settings whatever they would be.]

Robrecht Jacques’s picture

The webpath is: admin/settings/image. The "Default image path" setting is there. You can check whether it is "images" there (and NOT "images/").

If it is still "images", can you tell us what version you are using. It is the second line in "image.module" and should resemble something like
// $Id: image.module,v 1.3 2005/08/15 16:56:15 robrechtj Exp $

Thanks.

5dayapp’s picture

My bad. I just didn't realize that was the problem. It was that specific issue for the images file. Now, the tmp file shoudn't have been impacted here. But, I'll update to HEAD and see if maybe this whole thing isn't just my own problem and unrelated to the released code.

drewish’s picture

Status: Needs review » Closed (works as designed)