Hi, I've encountered an issue after updating from feeds 2.0 beta1 to beta2.

We have a feed that has no language information for the items, so the editors are manually assigning language on the imported nodes. On an update I realised the language information was lost, and all nodes that were manually set to Norwegian or English, were "updated" to Language Neutral ones, which is the default value in the settings for the node processor. Since there is no mapping related to the language of the node whatsoever this seems very much like a bug to me.

We first encountered this on updating from beta1 to beta3, but I have since found that this happens between beta1 and beta2. Also confirmed that it happens if updating to dev. If we stick to beta1, this information is not lost on a reimport of the feed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vegardjo created an issue. See original summary.

MegaChriz’s picture

True, since version 7.x-2.0-beta2, Feeds always set a language on an entity, which defaults to language neutral.

Perhaps the following lines in FeedsProcessor::entityLoad() should be removed?

if ($entity && !empty($info['entity keys']['language'])) {
  $entity->{$info['entity keys']['language']} = $this->entityLanguage();
}

Or maybe an option 'Leave unchanged' should be added on the language selector?

I've no time currently to work on Feeds. Would you like to create a fix yourself? This could also use an automated test.

vegardjo’s picture

Thanks for the pointer!

I'll probably not be able to do much more than maybe add a patch to remove those lines though, but I think that should be done. IMO it's ok that feeds sets a default language on first creation of a node, but doing this on update should *never* happen. It actually caused a considerable data loss for us that it did. In our case it was recoverable, but still.

I don't think it should be an option either, Feeds simply should never change any data unless explicitly told to.

efpapado’s picture

Attaching patch that deletes those lines.

efpapado’s picture

Status: Active » Needs review

(Change status to Needs review)

Status: Needs review » Needs work

The last submitted patch, 4: assigned_language_reset-2902533-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.