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

#624464 bangpound: Support tabs as delimiters.

parent 769754ce
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
Feeds 6.x 1.0 Alpha 14, 2010-04-11
----------------------------------
- #624464 bangpound: Support tabs as delimiters.
- #758664: Fix regression introduced with #740962.
Feeds 6.x 1.0 Alpha 13, 2010-03-30
......@@ -12,7 +13,7 @@ Feeds 6.x 1.0 Alpha 13, 2010-03-30
- #622932 pounard: Fix SQL capitalization.
- #622932 pounard: Fix non-standard SQL (PostgreSQL compatibility)
- #705872 Scott Reynolds: Added HTTPFetcher autodiscovery
- #740962 alex_b: Fix FileFetcher Attached to Feed Node, Upload Field Not Saving
- #740962 alex_b: Fix FileFetcher Attached to Feed Node, Upload Field Not Saving
File Path.
- #754938 Monkey Master: FeedsCSVParser.inc uses strtolower() while parsing
UTF-8 files.
......
......@@ -332,10 +332,8 @@ class FeedsDefaultsNodeTestCase extends FeedsDefaultsTestCase {
$this->drupalPost('import/node/import', array(), 'Import');
$this->assertText('Created 79 Story nodes.');
// Disable.
// Disable, nodes should be still present.
$this->disable('node');
// Nodes should be still present.
$count = db_result(db_query("SELECT COUNT(*) FROM {feeds_node_item}"));
$this->assertEqual($count, 79, 'Found correct number of items.');
$count = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE type = 'story' AND status = 1 AND uid = 0"));
......@@ -343,6 +341,19 @@ class FeedsDefaultsNodeTestCase extends FeedsDefaultsTestCase {
// Do not filter on type intentionally. There shouldn't be more than 8 nodes total.
$count = db_result(db_query("SELECT COUNT(*) FROM {node_revisions}"));
$this->assertEqual($count, 79, 'Found correct number of items.');
// Import a tab separated file.
$this->enable('node');
$this->drupalPost('import/node/delete-items', array(), 'Delete');
$edit = array(
'files[feeds]' => $this->absolutePath() .'/tests/feeds/nodes.tsv',
'feeds[FeedsCSVParser][delimiter]' => "\t",
);
$this->drupalPost('import/node', $edit, 'Import');
$this->assertText('Created 8 Story nodes.');
// Disable before exiting test.
$this->disable('node');
}
}
......
......@@ -86,7 +86,11 @@ class FeedsCSVParser extends FeedsParser {
'#type' => 'select',
'#title' => t('Delimiter'),
'#description' => t('The character that delimits fields in the CSV file.'),
'#options' => drupal_map_assoc(array(',', ';')),
'#options' => array(
',' => ',',
';' => ';',
"\t" => 'TAB',
),
'#default_value' => isset($source_config['delimiter']) ? $source_config['delimiter'] : ',',
);
return $form;
......@@ -108,7 +112,11 @@ class FeedsCSVParser extends FeedsParser {
'#type' => 'select',
'#title' => t('Default delimiter'),
'#description' => t('Default field delimiter.'),
'#options' => drupal_map_assoc(array(',', ';')),
'#options' => array(
',' => ',',
';' => ';',
"\t" => 'TAB',
),
'#default_value' => $this->config['delimiter'],
);
return $form;
......
Title Body published GUID
"Ut wisi enim ad minim veniam" "Ut wisi enim ad minim veniam quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat." 205200720 2
"Duis autem vel eum iriure dolor" "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi." 428112720 3
"Nam liber tempor" "Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum." 1151766000 1
Typi non habent"" "Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem." 1256326995 4
"Lorem ipsum" "Lorem ipsum dolor sit amet consectetuer adipiscing elit sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." 1251936720 1
"Investigationes demonstraverunt" "Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius." 946702800 5
"Claritas est etiam" "Claritas est etiam processus dynamicus qui sequitur mutationem consuetudium lectorum." 438112720 6
"Mirum est notare" "Mirum est notare quam littera gothica quam nunc putamus parum claram anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima." 1151066000 7
"Eodem modo typi" "Eodem modo typi qui nunc nobis videntur parum clari fiant sollemnes in futurum." 1201936720 8
\ No newline at end of file
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