Commit 31fda95c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5883-deserialization-errors-are-not-showed-during-csv-import' into '1.4-dev'

Resolve "Deserialization errors are not showed during CSV import"

See merge request fusiondirectory/fd-plugins!380
parents 10333046 4b244f9d
......@@ -228,9 +228,13 @@ class csvimport extends simplePlugin
$values[$m[1]][$m[2]] = $this->compute_attribute_value($attribute, $row);
}
$this->template_object->reset();
$this->template_object->deserialize($values);
$tabObject = $this->template_object->apply();
$msgs = $tabObject->save();
$msgs = $this->template_object->deserialize($values);
if ($msgs === TRUE) {
$tabObject = $this->template_object->apply();
$msgs = $tabObject->save();
} elseif (!is_array($msgs)) {
$msgs = array($msgs);
}
if (count($msgs)) {
$msg = '<ul><li>'.implode('</li><li>', $msgs).'</li></ul>';
msg_dialog::display(sprintf(_('Import failed for line %d'), $rownumber + 1), $msg, ERROR_DIALOG);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment