Hi,
the FeedsHTTPBatch files are stored in /files/ instead of /files/feeds/, due to a small "bug" in FeedsBatch.inc:
$dir = file_directory_path() .'/feeds/';
if (!file_check_directory($dir, TRUE)) {
throw new Exception(t('Feeds directory either cannot be created or is not writable.'));
}
$dest = file_destination($dir . get_class($this) .'_'. drupal_get_token($this->url) .'_'. time(), FILE_EXISTS_RENAME);
The problem is that file_check_directory trims all starting and trailing slashes "/".
The solution looks like this (see my comments):
// morningtime: removed trailing /
$dir = file_directory_path() .'/feeds';
if (!file_check_directory($dir, TRUE)) {
throw new Exception(t('Feeds directory either cannot be created or is not writable.'));
}
// morningtime: re-added trailing /
$dest = file_destination($dir . '/' . get_class($this) .'_'. drupal_get_token($this->url) .'_'. time(), FILE_EXISTS_RENAME);
Now files are stored in /files/feeds/ again.
Patch attached for HEAD.
Comments
Comment #1
Anonymous (not verified) commentedBesides the bug, I had two additional questions:
1. can we set a custom path with filefield_paths module? For example, feeds/2010/11/09/FeedBatch_2312321312_123123
2. I have a lot of feeds with settings "refresh=never, delete=never". Shouldn't we delete (cleanup) unused batch files, e.g. for those feeds with refresh=never?
Thanks
Comment #2
alex_b commentedThank you, running tests now.
1. Needs a separate issue. I could imagine adding a documented Drupal variable that is not surfaced on the UI.
2. #863494: Delete temporary enclosures file
Comment #3
alex_b commentedSorry, 2. is actually a different issue. I can't see how we delete them as we always allow a repeated import... I am open for suggestions, if you would like to discuss this, please open a separate issue.
Comment #4
alex_b commentedCommitted, thank you.
http://drupal.org/cvs?commit=398524