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.
Previously, when mapping to a Tag vocabulary, if the source data had commas, these would be saved as separate terms. I.e.:
"red, black, blue" ==> three tags : red, black, blue
However, this recently changed, to escape commas, which means that tags all end up smooshed together
"red, black, blue" ==> one tag : "red, black, blue"
You can trace this change backwards from #922868: Don't allow commas in tag names. In order to support the old behaviour (current code "breaks" sites that relied on that functionality), we need the ability to break-on-delimiter.
Comments
Comment #1
szadok CreditAttribution: szadok commentedSubscribing
Comment #2
Eric_A CreditAttribution: Eric_A commentedI just skimmed through the related issues and it somewhat confuses me. I'd say that the real issue is with escaping, not with the separator.
Drupal core allows for escaping data with the double quotes, i.e. "red, red", "black, black", "blue, blue" ==> three tags
It appears that #925264: Don't allow commas in tag names took a wrong turn conceptually, apart from breaking #873198: Import multiple values to tag vocabulary.
Comment #3
Eric_A CreditAttribution: Eric_A commentedThe syntax used in #2 is the way you would enter the terms in the Drupal node form. In a CSV file that would be something like """red, red"", ""black, black"", ""blue, blue""" if I remember correctly.
Comment #4
lyricnz CreditAttribution: lyricnz commentedThe point of Feeds is that we don't always have control of the file being consumed, so module should support both types of input - tag:"a,b" and tag:a tag:b
Comment #5
cedarm CreditAttribution: cedarm commentedThe taxonomy mapper is the wrong place for this code. Feeds cleanly abstracts tasks into Fetch, Parse, Process, and the splitting of tags should be the job of the Parser. I've supplied a replacement patch to #925264: Don't allow commas in tag names that will properly store the examples in #3 if supplied by the parser.
FWIW I'd really like to see Feeds Tamper be rolled into Feeds as a fourth stage between Parse and Process. Eg. Fetch -> Parse -> Filter -> Process.
Comment #6
tterranigma CreditAttribution: tterranigma commentedYou could use feeds tamper to split the tags either using a comma, a dash or whatever. As mentioned in #4, feeds should and does support tags with comma in the name. This is also the behavior for Feeds 7.x.