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!

 

 

Reply

  • Allowed HTML tags: <b> <br> <p> <a> <strong> <cite> <em> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You may use [img:xx] tags to display uploaded files or images inline.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <css>, <diff>, <drupal5>, <html>, <javascript>, <php>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options