Skip to content
Snippets Groups Projects
Commit 45152d37 authored by git's avatar git Committed by Chris Leppanen
Browse files

Issue #2011240 by ressa, Abelito: How to import the description of a file?

parent 006234fc
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,14 @@ function file_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_nam ...@@ -37,6 +37,14 @@ function file_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_nam
'real_target' => $name, 'real_target' => $name,
); );
} }
elseif ($info['type'] === 'file') {
$targets[$name . ':description'] = array(
'name' => t('@label: Description', array('@label' => $instance['label'])),
'callback' => 'file_feeds_set_target',
'description' => t('The description of the @label field.', array('@label' => $instance['label'])),
'real_target' => $name,
);
}
} }
} }
} }
...@@ -98,6 +106,7 @@ function file_feeds_set_target($source, $entity, $target, array $values) { ...@@ -98,6 +106,7 @@ function file_feeds_set_target($source, $entity, $target, array $values) {
switch ($sub_field) { switch ($sub_field) {
case 'alt': case 'alt':
case 'title': case 'title':
case 'description':
$field[LANGUAGE_NONE][$delta][$sub_field] = $v; $field[LANGUAGE_NONE][$delta][$sub_field] = $v;
break; break;
......
File mode changed from 100755 to 100644
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