It seems odd to me to have the feed_nid property exposed as a mapping target, but I don't know enough about Feeds to be certain...

Comments

MegaChriz’s picture

Status: Active » Postponed (maintainer needs more info)

I don't see this property as a mapping target (using the latest dev of Feeds). Can you provide the steps needed to have this property available as mapping target?

joachim’s picture

I was using Feeds with Data module to import from a CSV file to a Data table entity type.

MegaChriz’s picture

Component: Code » Generic entity processor
Status: Postponed (maintainer needs more info) » Active

Ah, I see. This mapping target is only available when using the "Generic entity processor". And it is available due to the following code from plugins/FeedsEntityProcessor.inc, ± line 244:

$wrapper = entity_metadata_wrapper($this->entityType(), NULL, $info);
// @todo: maybe restrict to data types feeds can deal with.
foreach ($wrapper->getPropertyInfo() as $name => $property) {
  if (empty($property['field'])) {
    $targets[$name] = array(
      'name' => $property['label'],
      'description' => isset($property['description']) ? $property['description'] : NULL,
    );
  }
}

"feed_nid" is defined as an entity property in feeds_entity_property_info_alter() and as a result it became available as a mapping target.

It doesn't look intentional. There is also no information available about why this is a mapping target in #1033202: [Meta] Generic entity processor.
I think this property should be removed as a mapping target.

MegaChriz’s picture

Project: Feeds » Feeds entity processor
Version: 7.x-2.x-dev » 7.x-1.x-dev
Component: Generic entity processor » Code

Moving to the Feeds entity processor project, the new home for the generic entity processor.

MegaChriz’s picture

Status: Active » Closed (works as designed)

The property "feed_nid" is no longer exposed as a mapping target. Mapping targets are created only for properties which have a setter callback now. This was changed in the following commit: http://drupalcode.org/project/feeds_entity_processor.git/commit/f7e70db

So this is no longer an issue.