Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2011 at 20:22 UTC
Updated:
20 Jan 2012 at 22:10 UTC
Jump to comment: Most recent file
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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1219180-feeds-api-example.patch | 620 bytes | dandaman |
| #1 | 1219180-feeds-api-example.patch | 596 bytes | dandaman |
Comments
Comment #1
dandaman commentedHere's a patch to match the suggested change.
Comment #2
emackn commentedshould probably update 'und' to use $entity->language
Comment #3
dandaman commentedOK, here's an updated version with your recommendations taken into account.
Comment #4
emackn commentedpatch 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.