Hi
I'm doing a feeds import programatically, and it's working, (code below) but when I want to import several feeds in a loop, I get errors with this message: "Object is not persistent", these errors come from feeds_source not loading correctly the export_type property of the feeds and it always thinks that is FEEDS_EXPORT_NONE (mine should get EXPORT_IN_CODE).
What I've found is that feeds_source loads the feeds instance from FeedsSource object in the instance method which does a static call to $instance and this doesn't load the export_type correctly.
I understand this is a very particular use case, but now with feeds for D7 you can't do imports programatically that need more than one iteration (i.e large files).
Maybe a solution for this can be replacing static $instance call for a drupal_static and/or allowing to reset that variable when invoking feeds_source function.
code:
$feedSource = feeds_source($feed);
$config = $feedSource->getConfig();
$config['FeedsFileFetcher']['source'] = $filename;
$feedSource->setConfig($config);
$feedSource->save();
do {
// Run the import process
$status_import = $feedSource->existing()->import();
} while ($status_import != FEEDS_BATCH_COMPLETE);
Comments
Comment #1
irinaz commented