How do I debug my Feeds import not importing a field I have a Feeds import set up to import products into Drupal Commerce (from csv). My product type has a number of term reference fields that also need to be assigned a value by import. Most of these work fine (e.g.: field_product_unit, field_product_discount_category), except one: field_product_group. I'm searching the taxonomy term by term name.

Importing the product group used to work at some point, but for some reason or other, it stopped working. Not a single value gets imported. I can't pinpoint when it quit on me. I don't see an obvious difference between the fields that do work, and the one that doesn't. The only slight difference is that product groups are hierarchical, and the other taxonomy lists don't use hierarchy.

I don't get any error messages or "I can't find this term" notices.

I've tried the following:


checked and double-checked the names of the terms matching the csv values: they do.
importing my taxonomy term name into a text field (to make sure it could find the input field): works fine.
my taxonomy lists all use multilingual names and descriptions. To avoid a mix-up there, I reset it to a single language: no difference


How do I proceed now? How can I figure out what's going wrong?
As a first step, you could check whether the field has been parsed properly:

In sites/all/modules/feeds/plugins/FeedsProcessor.inc:

Add debug($item) after line 180:

  public function process(FeedsSource $source, FeedsParserResult $parser_result) {
    $state = $source-&gt;state(FEEDS_PROCESS);

    while ($item = $parser_result-&gt;shiftItem()) {
       debug($item); // debug entry

      // Check if this item already exists.
      $entity_id = $this-&gt;existingEntityId($source, $parser_result);
     ...


debug() is a core function that lets you print out debugging information:

https://api.drupal.org/api/drupal/includes!common.inc/function/debug/7 and/or

http://blog.boombatower.com/drupal-7-debug-and-simpletest-verbose?utm_source=buffer&amp;utm_campaign=Buffer&amp;utm_content=buffer5ee6f&amp;utm_medium=twitter

The result will be processed using drupal_set_message(), and will appear in http://example.com/admin/reports/dblog (probably, depending on your configuration). 

You'll get one notice for each imported line, like:

User notice:

array (
  'title' =&gt; 'This is a test title',
  'body' =&gt; 'And a test body',
  'tax' =&gt; 'And a taxonomy term',
  '' =&gt; '',
)


Alternative: download (from http://drupal.org/project/devel, or drush dl devel) and enable the Development module (Devel in admin/modules), or drush en devel and use drupal_debug() or another tool from the devel module.