If a link match can't be found, do not clear the field but leave it so the plugin can try

This commit is contained in:
Nathan Gray 2013-01-08 15:56:11 +00:00
parent 89b4ce31e8
commit 88d1c1eefa

View File

@ -320,7 +320,7 @@ class importexport_import_csv implements importexport_iface_import_record { //,
if(!is_numeric($record[$name]))
{
$results = egw_link::query($links[$name], $record[$name]);
if(count($results) > 1)
if(count($results) >= 1)
{
// More than 1 result. Check for exact match
$exact_count = 0;
@ -340,12 +340,12 @@ class importexport_import_csv implements importexport_iface_import_record { //,
$warnings[] = lang('Unable to link to %1 "%2"',
lang($links[$name]), $record[$name]).
' - ' .lang('too many matches');
$record[$name] = null;
continue;
}
elseif ($exact_count == 1)
{
$record[$name] = $app_id;
continue;
}
}
if (count($results) == 0)
@ -353,7 +353,6 @@ class importexport_import_csv implements importexport_iface_import_record { //,
$warnings[] = lang('Unable to link to %1 "%2"',
lang($links[$name]), $record[$name]).
' - ' . lang('no matches');
$record[$name] = null;
continue;
} else {
$record[$name] = key($results);