mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-14 09:58:16 +01:00
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:
parent
89b4ce31e8
commit
88d1c1eefa
@ -320,7 +320,7 @@ class importexport_import_csv implements importexport_iface_import_record { //,
|
|||||||
if(!is_numeric($record[$name]))
|
if(!is_numeric($record[$name]))
|
||||||
{
|
{
|
||||||
$results = egw_link::query($links[$name], $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
|
// More than 1 result. Check for exact match
|
||||||
$exact_count = 0;
|
$exact_count = 0;
|
||||||
@ -340,12 +340,12 @@ class importexport_import_csv implements importexport_iface_import_record { //,
|
|||||||
$warnings[] = lang('Unable to link to %1 "%2"',
|
$warnings[] = lang('Unable to link to %1 "%2"',
|
||||||
lang($links[$name]), $record[$name]).
|
lang($links[$name]), $record[$name]).
|
||||||
' - ' .lang('too many matches');
|
' - ' .lang('too many matches');
|
||||||
$record[$name] = null;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
elseif ($exact_count == 1)
|
elseif ($exact_count == 1)
|
||||||
{
|
{
|
||||||
$record[$name] = $app_id;
|
$record[$name] = $app_id;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($results) == 0)
|
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"',
|
$warnings[] = lang('Unable to link to %1 "%2"',
|
||||||
lang($links[$name]), $record[$name]).
|
lang($links[$name]), $record[$name]).
|
||||||
' - ' . lang('no matches');
|
' - ' . lang('no matches');
|
||||||
$record[$name] = null;
|
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
$record[$name] = key($results);
|
$record[$name] = key($results);
|
||||||
|
Loading…
Reference in New Issue
Block a user