found a problem with imagecache not creating thumbs in drupal

I was building a site for a client and all imagecache stopped working before I uploaded to the live server.

When I uploaded, all of a sudden imagecache stopped working. I checked the usual things (permissions, original image exists) and everything was fine.

After some debugging I found that:

  • imagecache_cache() checks to see if the file exists using file_create_path()
  • file_create_path() checks the temp directory before it checks the files/ directory using file_directory_temp()
  • file_directory_temp() gets the temp directory using variable_get('file_directory_temp', NULL)

Great! So I go into the variables table and delete file_directory_temp.

But the problem is still there. Mre debugging:

  • variable_get() can load variables from cache and not from the database using cache_get('variables', 'cache')

Ok, so I go into the cache table and delete variables.

Problem Solved!