Skip to content
Snippets Groups Projects
Commit 9e89fdfe authored by franz's avatar franz Committed by Chris Leppanen
Browse files

Issue #1110762 by vaartio, franz, bancarddata, axel.rutz: Fixed Feeds does not...

Issue #1110762 by vaartio, franz, bancarddata, axel.rutz: Fixed Feeds does not catch file exceptions properly in file mapper and FeedsParser.inc getFile() function.
parent a921c43b
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,13 @@ function file_feeds_set_target($source, $entity, $target, $value) { ...@@ -75,7 +75,13 @@ function file_feeds_set_target($source, $entity, $target, $value) {
$i = 0; $i = 0;
$field = isset($entity->$target) ? $entity->$target : array(); $field = isset($entity->$target) ? $entity->$target : array();
foreach ($value as $v) { foreach ($value as $v) {
if ($file = $v->getFile($destination)) { try {
$file = $v->getFile($destination);
}
catch (Exception $e) {
watchdog_exception('Feeds', $e, nl2br(check_plain($e)));
}
if ($file) {
$field['und'][$i] = (array)$file; $field['und'][$i] = (array)$file;
$field['und'][$i]['display'] = 1; // @todo: Figure out how to properly populate this field. $field['und'][$i]['display'] = 1; // @todo: Figure out how to properly populate this field.
if ($info['cardinality'] == 1) { if ($info['cardinality'] == 1) {
......
...@@ -368,7 +368,12 @@ class FeedsEnclosure extends FeedsElement { ...@@ -368,7 +368,12 @@ class FeedsEnclosure extends FeedsElement {
if (file_uri_target($destination)) { if (file_uri_target($destination)) {
$destination = trim($destination, '/') . '/'; $destination = trim($destination, '/') . '/';
} }
$file = file_save_data($this->getContent(), $destination . $filename); try {
$file = file_save_data($this->getContent(), $destination . $filename);
}
catch (Exception $e) {
watchdog_exception('Feeds', $e, nl2br(check_plain($e)));
}
} }
// We couldn't make sense of this enclosure, throw an exception. // We couldn't make sense of this enclosure, throw an exception.
......
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