diff --git mappers/file.inc mappers/file.inc index 23dcd8b..aadb297 100644 --- mappers/file.inc +++ mappers/file.inc @@ -72,7 +72,13 @@ function file_feeds_set_target($source, $entity, $target, $value) { $i = 0; $field = isset($entity->$target) ? $entity->$target : array(); foreach ($value as $v) { - if ($file = $v->getFile($destination)) { + try { + $file = $v->getFile($destination); + } + catch (Exception $e) { + watchdog('Feeds', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_WARNING); + } + if ($file) { $field['und'][$i] = (array)$file; $field['und'][$i]['display'] = 1; // @todo: Figure out how to properly populate this field. if ($info['cardinality'] == 1) { diff --git plugins/FeedsParser.inc plugins/FeedsParser.inc index 4995797..853e4d1 100644 --- plugins/FeedsParser.inc +++ plugins/FeedsParser.inc @@ -323,7 +323,12 @@ class FeedsEnclosure extends FeedsElement { require_once (drupal_get_path('module', 'transliteration') . '/transliteration.inc'); $filename = transliteration_clean_filename($filename); } - $file = file_save_data($this->getContent(), "$destination/$filename"); + try { + $file = file_save_data($this->getContent(), "$destination/$filename"); + } + catch (Exception $e) { + watchdog('Feeds', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_WARNING); + } } // We couldn't make sense of this enclosure, throw an exception.