I am trying to import a CSV of user profiles. I have set up a feed using the entity processor branch to allow setting the processor to: "Entity processor Profile". On the settings page for the processor I have the following:
"Default values
Most of the values below can be overriden by mapping a value." (Also there is a minor spelling mistake there = "overridden")

Type *
{Contact Profile}
Label
{Blank}
Date created
{Blank}
User *
{1}

In my mapping I have a csv column called 'uid' mapped to the User target. I believe that should override the author of the profile but it does not. All the profiles are imported linked to user 1.
I tried to take a look through the code but couldn't find where the defaults are set in the time I had.

Comments

lolcode’s picture

Title:Enity Processor branch: Default author of entity not overidden by mapping to uid» Entity Processor branch: Default author of entity not overidden by mapping to uid

I have noticed another issue. I am not sure if it is related. The choice of "Entity processor Profile" is not properly staying persistent. When I edit the feed and return to the Processor choice page it has reset the radio button to "Entity processor User". I confirmed this by re-saving this page, leaving the processor choice page and returning. However, it is not losing my settings for the "Entity processor Profile". If I click on processor settings it still has the Contact Profile selected in the dropdown. Also the import process is creating Profiles not users, it's just that all of them are owned by user 1.

Also fixing typo in title.

Sharique’s picture

I'm having same problem.
It would be better if matching is done using either username or email.

retiredpro’s picture

Issue summary:View changes

Same problem here using the latest dev version of feeds. Anybody found a solution yet?

Vulsutyr’s picture

I was able to work around this by copying the setTargetElement function from FeedsNodeProcessor.inc and putting it into FeedsEntityProcessor.inc then modifying it as I needed. My function ended up looking like this:

<?php
 
public function setTargetElement(FeedsSource $source, $target_node, $target_element, $value) {
    switch (
$target_element) {
      case
'author':
         
$target_node->uid = $value;
        break;
      default:
       
parent::setTargetElement($source, $target_node, $target_element, $value);
        break;
    }
  }
?>

I have a column of uid's so I simply set the uid of the node to the mapped value.

gerson.analista’s picture

I'm having the same problem to import the type Profile2 entities. The code #4 worked to me, I only had to change the line "case 'author':" to "case 'user':"

public function setTargetElement(FeedsSource $source, $target_node, $target_element, $value) {
    switch ($target_element) {
      case 'user':
          $target_node->uid = $value;
        break;
      default:
        parent::setTargetElement($source, $target_node, $target_element, $value);
        break;
    }
  }
MegaChriz’s picture

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

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