I'm getting error messages importing multiple taxonomy terms.

1) Without a tamper, single taxonomy terms are importing correctly.

2) After adding an 'explode' tamper, there is an error message:
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'Praia dos Carneiros' AND vid = '1'' at line 1

3) If I go back and edit the feed mapping and change 'Target Configuration' from 'Used as unique' to 'Not used as unique', the result is three warning messages:

Term name missing.
Term name missing.
Term name missing.

followed by a status message:
Failed importing 3 terms.
(By the way, the setting 'Used as unique' was required to prevent duplicate tags from being added.)
______________

Configuration
The 3 multiple taxonomy term fields are formatted as:

"Brazil,Praia dos Carneiros"
"Brazil,Recife,WC watching spot"
"Brazil,Porto de Galinhas"

Using Feeds Tamper 7.x-1.0, Feeds 7.x-2.0-alpha8, Drupal core 7.30, PHP Version 5.4.19

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mark_L6n’s picture

Issue summary: View changes
twistor’s picture

Component: Miscellaneous » Code
Status: Active » Postponed (maintainer needs more info)

Are you using the Term Processor to do this? If so, then the explode won't work.

If you're trying to import tags that belong to nodes, then you don't need to import the terms separately.

Mark_L6n’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Yes, I am using the Taxonomy term processor.
And thanks for the note; yes, I'm trying to import tags that are used by nodes, so I'll just create the nodes that way instead of importing them.

paddy_deburca’s picture

I have has a similar issue - all items were being imported at once into one array rather than item by item into individual terms.

The problem stems from the structure of the XML file - in this case from Flickr API

<rsp stat="ok">
  <who>
    <tags>
      <tag>giantscauseway</tag>
      <tag>ireland</tag>
      <tag>nothernireland</tag>
      <tag>portfolio</tag>
      <tag>rockofcashel</tag>
      <tag>stonehenge</tag>
    </tags>
  </who>
</rsp>

All tag items are under one single instance of tags.

The obvious context to use to import these items is /rsp/who/tags; but this imports all tag items into one array.

I have looked at some other solutions using Feeds Tamper - but failed :-(

The solution to my problem turned out to be to set the context to //tags/tag ensuring that tag are treated individually. Leaving me with the problem - what to assign to "Term name" in the field mappings - and the solution to this is to use text() an Path function that returns the text of an item.

To summarise:

  • XPath setting are

    Path settings

  • Mappings are

    Mapping

  • Import result

    Import result

Paddy.