Line 489:

  $cachedir = _signwriter_get_val($profile->cachedir, 'signwriter-cache');

The outcome of this is when file_check_directory() is called on line 504 drupal attempts to create /signwriter-cache some where other than the drupal files path (I'd assume it's trying to create it at / ).
Error Message: "mkdir() [function.mkdir]: Permission denied in /%systempathtodrupal%/includes/file.inc on line 91.

By adding file_directory_path() along with a backslash to line 489:

$cachedir = _signwriter_get_val($profile->cachedir, file_directory_path().'/signwriter-cache');

The folder is created in your files folder as defiened by the settings page. Without this change the module can not function....unless I've completely missed something...

Comments

wrunt’s picture

Hi hyrcan,

Using drupalpath/signwriter-cache should work, as long as your web server has permissions to create and then write to that directory. I've just committed a change to cvs that will let you change signwriter's cache dir, so you can change it to files/signwriter-cache in your installation. I'm not going to change it to that by default, because if someone were to create drupal's files directory outside of the drupal dir, and make it private (on the main settings page), then signwriter wouldn't work.

patricksettle’s picture

Most drupal installs I've come across only allow write access to the file_directory_path, not to the root of the webfolder. So useing the path to the drupal root folder wouldn't work. Moving signwriter-cache into drupal's 'files' directory as specified by the user via the settings page, is ideal. This is where most people expect files created by the system to end up, this is the first module that I've found to -not- do that. As Signwriter braking because someone's made their files directory private, then wouldn't it be best to just use file_transfer to handle getting the image like normal?

wrunt’s picture

Thanks hyrcan, I didn't know about the file_transfer function. I guess we could put in a callback that calls file_transfer, and output the callback's path as the url if the files directory is set to private. I haven't got time right now, but I'll get around to it some day. If you feel like doing this patch yourself, you're quite welcome :)

agileware’s picture

Status: Active » Fixed

This was fixed when the feature allowing users to set the cache directory was added.

agileware’s picture

Status: Fixed » Closed (fixed)