mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Give an error if the custom field we're supposed to be matching against can't be found
This commit is contained in:
parent
03671abeb8
commit
ca1c9e681a
@ -515,18 +515,26 @@ class infolog_import_infologs_csv implements importexport_iface_import_plugin {
|
|||||||
if($app && $custom_field && $value)
|
if($app && $custom_field && $value)
|
||||||
{
|
{
|
||||||
$cfs = config::get_customfields($app);
|
$cfs = config::get_customfields($app);
|
||||||
|
// Error if no custom fields, probably something wrong in definition
|
||||||
if(!$cfs[$custom_field])
|
if(!$cfs[$custom_field])
|
||||||
{
|
{
|
||||||
// Check for users specifing label instead of name
|
// Check for users specifing label instead of name
|
||||||
foreach($cfs as $name => $settings)
|
foreach($cfs as $name => $settings)
|
||||||
{
|
{
|
||||||
if($settings['label'] == $custom_field)
|
if(strtolower($settings['label']) == strtolower($custom_field))
|
||||||
{
|
{
|
||||||
$custom_field = $name;
|
$custom_field = $name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Couldn't find field, give an error - something's wrong
|
||||||
|
if(!$cfs[$custom_field] && !$cfs[substr($custom_field,1)]) {
|
||||||
|
$this->errors[$record_num] .= lang('No custom field "%1" for %2.',
|
||||||
|
$custom_field, lang($app));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if($custom_field[0] != '#') $custom_field = '#' . $custom_field;
|
if($custom_field[0] != '#') $custom_field = '#' . $custom_field;
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
|
Loading…
Reference in New Issue
Block a user