I wanted to make my own Feeds target, so I copied the following function:

function my_module_set_target($source, $entity, $target, $value) {
  $entity->$target['und'][0]['value'] = $value;
  if (isset($source->importer->processor->config['input_format'])) {
    $entity->$target['und'][0]['format'] =
      $source->importer->processor->config['input_format'];
  }

When my module tried to run this callback, it gave me "Internal Server Error" messages. After a bit of work, I found where the Entity target callback was doing it and it had brackets around the $target variable.

Comments

dandaman’s picture

Status: Active » Needs review
StatusFileSize
new596 bytes

Here's a patch to match the suggested change.

emackn’s picture

Status: Needs review » Needs work

should probably update 'und' to use $entity->language

dandaman’s picture

Status: Needs work » Needs review
StatusFileSize
new620 bytes

OK, here's an updated version with your recommendations taken into account.

emackn’s picture

Status: Needs review » Fixed

patch didn't apply so i just added it by hand since it was a quick fix. Thanks!

committed:
d023593 Issue #1219180 by dandaman: Fixed Minor error in API code samples.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.