Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
b831c72e
Commit
b831c72e
authored
14 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
#624464 lyricnz, alex_b: Fix to 'support tabs as delimiters'.
parent
cafae7ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.txt
+1
-0
1 addition, 0 deletions
CHANGELOG.txt
feeds_defaults/tests/feeds_defaults.test
+1
-1
1 addition, 1 deletion
feeds_defaults/tests/feeds_defaults.test
plugins/FeedsCSVParser.inc
+4
-3
4 additions, 3 deletions
plugins/FeedsCSVParser.inc
with
6 additions
and
4 deletions
CHANGELOG.txt
+
1
−
0
View file @
b831c72e
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
feeds_defaults/tests/feeds_defaults.test
+
1
−
1
View file @
b831c72e
...
...
@@ -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.'
);
...
...
This diff is collapsed.
Click to expand it.
plugins/FeedsCSVParser.inc
+
4
−
3
View file @
b831c72e
...
...
@@ -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'
],
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment