Number of columns in file must match number of columns in sample file given to definition instead of number of columns imported (to get non-imported columns working again)

r40944: Do not consider stop flag when clearing empty conditions
This commit is contained in:
Nathan Gray 2012-11-27 15:41:27 +00:00
parent 4d74289931
commit bb496273c9
2 changed files with 5 additions and 3 deletions

View File

@ -310,7 +310,7 @@
$data = translation::convert($data,$options['charset']);
$ok = true;
if(count($data) != count($options['field_mapping']) && max(array_keys($data)) != max(array_keys($options['field_mapping'])))
if(count($data) != count($options['csv_fields']) && max(array_keys($data)) != max(array_keys($options['csv_fields'])))
{
$message[] = lang("Column mismatch. Expected %1 columns, your file has %2.",
count($options['field_mapping']),

View File

@ -369,8 +369,10 @@ class importexport_wizard_basic_import_csv
// Clear conditions that don't do anything
array_shift($content['conditions']);
foreach($content['conditions'] as $key => &$condition) {
if(($condition['true']['action'] == 'none' || !$condition['true']['action']) && !$condition['true']['stop']
&& ($condition['false']['action'] == 'none' || !$condition['false']['action']) && !$condition['false']['stop']) {
if(($condition['true']['action'] == 'none' || !$condition['true']['action'])
&& ($condition['false']['action'] == 'none' || !$condition['false']['action']) &&
!$condition['string']
) {
unset($content['conditions'][$key]);
continue;
}