Skip to content
Snippets Groups Projects
Commit 1c6777a4 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Issue #1551852 by Sergii: Fixed Text field mapper: support for FeedsElement object.

parent ceb98ddc
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,9 @@ function _field_feeds_set_target($source, $entity, $target, $value, $input_forma ...@@ -110,6 +110,9 @@ function _field_feeds_set_target($source, $entity, $target, $value, $input_forma
$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 (is_object($v) && ($v instanceof FeedsElement)) {
$v = $v->getValue();
}
if (!is_array($v) && !is_object($v)) { if (!is_array($v) && !is_object($v)) {
$field['und'][$i]['value'] = $v; $field['und'][$i]['value'] = $v;
} }
......
...@@ -54,6 +54,9 @@ function link_feeds_set_target($source, $entity, $target, $value) { ...@@ -54,6 +54,9 @@ function link_feeds_set_target($source, $entity, $target, $value) {
$info = field_info_field($target); $info = field_info_field($target);
list($field_name, $sub_field) = explode(':', $target); list($field_name, $sub_field) = explode(':', $target);
foreach ($value as $v) { foreach ($value as $v) {
if (is_object($v) && ($v instanceof FeedsElement)) {
$v = $v->getValue();
}
if (!is_array($v) && !is_object($v)) { if (!is_array($v) && !is_object($v)) {
if (strstr($target, 'url')) { if (strstr($target, 'url')) {
if (isset($entity->{$field_name}['und'][$i]['title'])) { if (isset($entity->{$field_name}['und'][$i]['title'])) {
......
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