Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have an importer which works well when I start the import from browser. It has a tamper plugin to put a default value to a field.
But when I start the import from code, everything works except the tamper plugin. Here is the code I am usinng to start importer:
$feedSource = feeds_source('my_importer');
while (FEEDS_BATCH_COMPLETE != $feedSource->import());
Do I need to specify the config of the importer from the code, to include tamper settings?
Comments
Comment #2
Sinan Erdem CreditAttribution: Sinan Erdem commentedIt looks like the problem is originating from another module "Feeds Extensible Parsers". I created an issue here: #2709401: When running importer from code, only one field is updated properly
Comment #3
dimexz CreditAttribution: dimexz commentedGot same problem with common CSV parser.
Undefined index: NNN in feeds_tamper_load_by_importer()
Comment #4
dimexz CreditAttribution: dimexz commentedAn alternative way to run import from CLI is using Drush Feeds Import sandbox module (need 'Process in Background' configured):
In this case tamper works fine.
Comment #5
dimexz CreditAttribution: dimexz commentedUPD: Since 7.53 Drupal and 8.1 drush (logic & syntax changed):
Comment #6
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@dimexz
Since 7.x-2.0-beta3 you also no longer need to use the Drush Feeds Import sandbox module. Drush support is now built-in!
For more information about the command 'feeds-import', see also https://drushcommands.com/drush-7x/feeds/feeds-import or type
drush help feeds-import
.