Skip to content
Snippets Groups Projects
Commit 38bdd6df authored by Alex Barth's avatar Alex Barth
Browse files

#755556 Monkey Master, andrewlevine, alex_b: Support saving local files in filefields.

parent e2f0f434
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@
Feeds 6.x xxxxxxxxxxxxxxxxxxxxxx
--------------------------------
- #755556 Monkey Master, andrewlevine, alex_b: Support saving local files in
filefields.
- #891982 bangpound, twistor: Support Link 2.x.
- #870278 budda: Fix SQL query in taxonomy_get_term_by_name_vid().
- #795114 budda, alex_b: Taxonomy term processor doesn't require vocabulary to
......
......@@ -245,6 +245,16 @@ class FeedsEnclosure extends FeedsElement {
*/
public function getFile() {
if(empty($this->file) && $this->getValue()) {
// Check if this enclosure contains a local file.
if (!parse_url($this->getValue(), PHP_URL_SCHEME)) {
if (file_check_location($this->getValue(), file_directory_path())) {
if (file_exists($this->getValue())) {
$this->file = $this->getValue();
return $this->file;
}
}
throw new Exception(t('Invalid enclosure %enclosure', array('%enclosure' => $this->getValue())));
}
$filename = basename($this->getValue());
if (module_exists('transliteration')) {
require_once (drupal_get_path('module', 'transliteration') . '/transliteration.inc');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment