On a windows system, the default temporary directory comes up as "c:\windows\temp" in admin/settings.

On loading the screen, I get the usual error message "The directory c:\windows\temp does not exist." - because I'm on Win2k, which uses "c:\winnt" instead. That's fine, except I can't actually make any changes to the page while that error message is still there: "The settings have not been saved because of the errors."

In other words, the screen is unusable if the path can't be found.

CommentFileSizeAuthor
#1 file-temp-win.patch712 bytesasimmonds
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

asimmonds’s picture

Status: Active » Needs review
FileSize
712 bytes

Could we do something like this patch?

What I don't know is, what's the most common temp directory environment variable on a windows platform TEMP or TMP?

Thox’s picture

I admit that might solve the problem in my case, but is it the wrong way around to fix things? Regardless of the value of the field, it should never prevent you from changing it simply because it can't find a folder.

FYI, my Win2k system here has TMP and TEMP both set.

Geary’s picture

Status: Needs review » Needs work

The code should not contain any hard coded paths whatsoever. With the patch, the code still defaults to c:\windows\temp if the TEMP environment variable is not found. This is completely wrong. There is *no* standard default temp directory on Windows. If Drupal cannot find the correct temp directory, it should refuse to run, not take a wild guess like this.

Geary’s picture

Hmm... When running PHP under XAMPP on Windows, the $_ENV array is empty! This is not promising...

asimmonds’s picture

Status: Needs work » Active

IMO, this (http://drupal.org/node/26249) solution is better and it's not dependent on environmental variables.

Bèr Kessels’s picture

http://drupal.org/node/35575 is the same bug, I think.

dopry’s picture

Status: Active » Fixed

fixed by bug -> node/35575.

Anonymous’s picture

Status: Fixed » Closed (fixed)