Creating an importer for a content import for a client. The supplied CSV file(s) include no column headers so I am using the "No Headers" option on import. However, when creating the mappings I am unable to map column 0 (as the file parses to a 0-based array) to a field. This is significant as there is valid data in column 0 and it does not work to modify the file(s) to add an empty column.

I have attached a patch which modifies the feeds_ui_mapping_form_validate and feeds_ui_mapping_form_submit to explicitly check if the submitted value is '0' as the current implementation of empty($form_state['values']['source']) evaluates to TRUE when 0 is submitted which thereby prevents mapping column 0 to any field(s).

I've tested this patch for my files when using the import with no headers option and it works successfully.

CommentFileSizeAuthor
enable_column0_no_headers_import.patch1.44 KBbjcone
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

patrickfgoddard’s picture

Looks like dupe or similar to: https://drupal.org/node/1984962

In the meantime, I was able to put "00" (two zeros) and was able create mapping and complete an import.

MegaChriz’s picture

Status: Active » Closed (duplicate)

Yes, this is a duplicate of #1984962: Use a 0 as mapping source.