fix: [import modules] Avoiding issues with userConfig when module is csvimport

- If users tick the checkbox to specify there is a
  header in the csv file to import, there should
  not be an error with empty userConfig header
pull/3707/head
chrisr3d 2018-08-03 13:32:51 +02:00
parent 07645de9ac
commit afbb83a827
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 5 additions and 0 deletions

View File

@ -5114,6 +5114,11 @@ class EventsController extends AppController
$modulePayload['config'][$conf] = Configure::read('Plugin.Import_' . $moduleName . '_' . $conf);
}
}
if ($moduleName === 'csvimport') {
if (empty($this->request->data['Event']['config']['header']) && $this->request->data['Event']['config']['has_header'] === '1') {
$this->request->data['Event']['config']['header'] = ' ';
}
}
foreach ($module['mispattributes']['userConfig'] as $configName => $config) {
if (!$fail) {
if (isset($config['validation'])) {