Hello,

Not sure if this has been reported yet, did a little search and nothing came up, so assuming not known/discovered yet. Adding "0" (without the quotes) as a mapping source brings error: You must select a mapping source. Haven't dug into the code yet but from my past experience I'm almost certain that it's triggered by the empty() function.
There's probably something like:

if (empty($mapping_source)) {
  // report error
}

Which should be changed to something like:

if ($mapping_source === '') {
  // report error
}

Will provide a patch if I can spare some time out these days.

Comments

Jeffrey C.’s picture

Title: Zero evaluates to false in mapping source » Zero evaluates to empty in mapping source
Jeffrey C.’s picture

And I was right.

feeds_ui.admin.inc:

if (empty($form_state['values']['source'])) {
  form_error($form['source'], t('You must select a mapping source.'));
}

This should probably be changed, too:
if (empty($form_state['values']['source']) xor empty($form_state['values']['target'])) {

bbdata’s picture

Would this be the same issue as the one found here?
https://drupal.org/node/1984962

MegaChriz’s picture

Status: Active » Closed (duplicate)

@bbdata
Yes, well noted! This is indeed a duplicate of #1984962: Use a 0 as mapping source.

See the patch #6 of that issue:

+++ b/feeds_ui/feeds_ui.admin.inc
@@ -726,7 +726,7 @@ function feeds_ui_mapping_form_validate($form, &$form_state) {
-        if (empty($form_state['values']['source'])) {
+        if (!drupal_strlen($form_state['values']['source'])) {
           form_error($form['source'], t('You must select a mapping source.'));
         }