Skip to content
Snippets Groups Projects
Commit b831c72e authored by Alex Barth's avatar Alex Barth
Browse files

#624464 lyricnz, alex_b: Fix to 'support tabs as delimiters'.

parent cafae7ca
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
Feeds 6.x 1.X XXXX
------------------
- #624464 lyricnz, alex_b: Fix to "support tabs as delimiters".
- #840350 lyricnz: (Optionally) Transliterate enclosure filenames to provide
protection from awkward names.
- #842040 dixon_: Accept all responses from the 2xx status code series.
......
......@@ -347,7 +347,7 @@ class FeedsDefaultsNodeTestCase extends FeedsDefaultsTestCase {
$this->drupalPost('import/node/delete-items', array(), 'Delete');
$edit = array(
'files[feeds]' => $this->absolutePath() .'/tests/feeds/nodes.tsv',
'feeds[FeedsCSVParser][delimiter]' => "\t",
'feeds[FeedsCSVParser][delimiter]' => "TAB",
);
$this->drupalPost('import/node', $edit, 'Import');
$this->assertText('Created 8 Story nodes.');
......
......@@ -16,7 +16,8 @@ class FeedsCSVParser extends FeedsParser {
$iterator = new ParserCSVIterator(realpath($batch->getFilePath()));
$source_config = $source->getConfigFor($this);
$parser = new ParserCSV();
$parser->setDelimiter($source_config['delimiter']);
$delimiter = $source_config['delimiter'] == 'TAB' ? "\t" : $source_config['delimiter'];
$parser->setDelimiter($delimiter);
$parser->setSkipFirstLine(FALSE);
$rows = $parser->parse($iterator);
unset($parser);
......@@ -89,7 +90,7 @@ class FeedsCSVParser extends FeedsParser {
'#options' => array(
',' => ',',
';' => ';',
"\t" => 'TAB',
'TAB' => 'TAB',
),
'#default_value' => isset($source_config['delimiter']) ? $source_config['delimiter'] : ',',
);
......@@ -115,7 +116,7 @@ class FeedsCSVParser extends FeedsParser {
'#options' => array(
',' => ',',
';' => ';',
"\t" => 'TAB',
'TAB' => 'TAB',
),
'#default_value' => $this->config['delimiter'],
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment