In FeedsNodeProcessor::setTargetElement(), $value is assumed to be of type string, but it could be an array, for instance, from multiple category elements in a feed item.
Thus, this results in warnings from multiple parts of Drupal core... only visible on the dblog, or if you have full error reporting enabled.
One way to fix this would be to just check for arrays and imploding into a string: (also, see patch)
public function setTargetElement($target_node, $target_element, $value) {
if (in_array($target_element, array('url', 'guid'))) {
$target_node->feeds_node_item->$target_element = $value;
}
elseif ($target_element == 'body') {
+ if (is_array($value)) {
+ $value = implode(' ', $value);
+ }
$target_node->teaser = node_teaser($value);
$target_node->body = $value;
}
elseif (in_array($target_element, array('title', 'status', 'created', 'nid', 'uid'))) {
+ if (is_array($value)) {
+ $value = implode(' ', $value);
+ }
$target_node->$target_element = $value;
}
}
This problem will also happen in FeedsFeedNodeProcessor::setTargetElement(), BTW.
Comments
Comment #1
twistor commented