I'm using a new test CSV field. The feed element mapper has no problem showing an example feed item from the csv file, so it sems to be connected.
My problem is that when I assign some columns to cck fields and I try to save the form, nothing gets saved!
The value are all resetted back to "No Mapping" and I really don't know what's going on.
I have no error on screen, or in the logs... If I still refresh the feed, I get the nodes created with the right titles, but I don't have any mapped data.
This seems like an issue with the mapper, it seems that it does not save the mappins I want to add!!
Thanks for any help you could provide!
Patchak
Comments
Comment #1
patchak commentederrr.. it's not a new CSV field, but a CSV file...
Comment #2
alex_b commented1) Does this problem occur only with this feed or with any feed?
2) Go to _feedapi_mapper_store_mapping() and print $param, $mapping, $elements to screen - do the values seem to be correct?
3) If they are, can you verify that they are being written to the database? (db_query() code is in the same function - _feedapi_mapper_store_mapping())
Comment #3
patchak commentedAlex : thanks for the reply... turns out I can't use a file with the column names wrapped in double quotes. Removing all the quotes from the column names sem to actually solve the problem.
Patchak
Comment #4
jesss commentedI'm running into a similar issue. I have a very simple CSV file that has two columns: first_name and last_name. I'm trying to map those two columns to two CCK text fields: field_first_name and field_last_name. However, only the first element is mapped.
Alex, I made the modification to _feedapi_mapper_store_mapping() that you suggested, and here is the result.
I'm thinking those weird line breaks in the middle of the last_name part of the mapping and element arrays are the most likely culprits, but I don't know where they're sneaking in. I've double- and triple-checked the CSV and don't see any strange characters or line breaks. It also doesn't matter which order the columns are in -- whichever column is second exhibits this behavior.
Comment #5
todddevice commentedI was able to solve this by changing the line break encoding in the CSV file.
parser_csv.inc looks for ASCII character 10, or UNIX-style LF:
The CSV in question was created in Windows, which encoded CR+LF line breaks. Hence the broken new line as the CR was preserved as part of the header.
Any additional check for the presence of CR+LF breaks in the parser_csv module is needed.
Comment #6
alex_b commented#5 suggests this is a parser issue. Does this problem persist in 6.x-dev which has an entirely different parser?